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.
2 parents e74c2db + 3fba2d4 commit c0a9138Copy full SHA for c0a9138
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