Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e74c2db commit 3fba2d4Copy full SHA for 3fba2d4
server.js
@@ -23,6 +23,11 @@ app.set('port', (process.env.PORT || 3000));
23
app.use('/', express.static(path.join(__dirname, 'public')));
24
app.use(bodyParser.json());
25
app.use(bodyParser.urlencoded({extended: true}));
26
+app.use(function(req, res, next) {
27
+ //set permissive CORS header
28
+ res.setHeader('Access-Control-Allow-Origin', '*');
29
+ next();
30
+});
31
32
app.get('/api/comments', function(req, res) {
33
fs.readFile(COMMENTS_FILE, function(err, data) {
0 commit comments