Skip to content

Commit

Permalink
Merge pull request #83 from tolulope-od/ch-setup-cors-165654051
Browse files Browse the repository at this point in the history
#165654051 Setup app for Cross Origin Resource Sharing for API endpoints
  • Loading branch information
tolulope-od committed Apr 27, 2019
2 parents a2414f6 + 52ee17e commit c3fc010
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import '@babel/polyfill';
import express from 'express';
import bodyParser from 'body-parser';
import cors from 'cors';
import swaggerUi from 'swagger-ui-express';
import logger from 'morgan';
import Debug from 'debug';
Expand All @@ -17,6 +18,9 @@ const app = express();
const PORT = process.env.PORT || 5000;
const API_PREFIX = '/api/v1';

// Set up app to use Cross-Origin Resource Sharing
app.use(cors());

/**
* @route /test
* @description use to test server response
Expand Down
9 changes: 9 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"body-parser": "^1.18.3",
"chai": "^4.2.0",
"chai-http": "^4.2.1",
"cors": "^2.8.5",
"coveralls": "^3.0.3",
"cross-env": "^5.2.0",
"debug": "^4.1.1",
Expand Down

0 comments on commit c3fc010

Please sign in to comment.