Before you're able to use your server from your application, you will need to configure it to allow for Cross-Origin Resource Sharing (CORS) so that your Angular application hosted on http://localhost:5000 can communicate with your mock server hosted on http://localhost:3000:
- Install the cors package:
$ npm i cors
- Update index.js to use cors:
server/index.js...var cors = ...app.use(cors())// Initialize the Swagger middlewareswaggerTools.initializeMiddleware(swaggerDoc, function(middleware) {...