-
Notifications
You must be signed in to change notification settings - Fork 26
Enabled cors #7
base: master
Are you sure you want to change the base?
Enabled cors #7
Conversation
Thank you for your contribution. I've just checked and your commit doesn't appear to be signed-off. That's something we need before your Pull Request can be merged. Please see our contributing guide. |
@@ -7,7 +7,7 @@ const express = require('express') | |||
const app = express() | |||
const handler = require('./function/handler'); | |||
const bodyParser = require('body-parser') | |||
|
|||
const cors = require("cors");// imported cors package |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- comment not useful
- prefer single quote
app.put('/*', middleware); | ||
app.use(cors());// enabled cors |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could use an instance Router instead of duplicating app.use(cors());
app.put('/*', middleware); | ||
app.use(cors());// enabled cors |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same //
Hi,
I was creating a short URL service with openfaas , while integrating the function with react js front end, It showed
. so I edited the templates which enable cors and it worked fine, so I thought it would be a good feature to add to the templates