Skip to content

Commit

Permalink
docs(website): enable cors globally
Browse files Browse the repository at this point in the history
  • Loading branch information
gregberge committed Nov 20, 2018
1 parent 7bf0f6f commit d4542fd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion website/server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ const handle = app.getRequestHandler()

app.prepare().then(() => {
const server = express()
server.post('/api/svgr', cors(), bodyParser.json(), (req, res) => {

server.use(cors())

server.post('/api/svgr', bodyParser.json(), (req, res) => {
svgr(req.body.code, { ...req.body.options, plugins: [svgo, jsx, prettier] })
.then(output => {
res.send({ output })
Expand Down

1 comment on commit d4542fd

@vercel
Copy link

@vercel vercel bot commented on d4542fd Nov 20, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully aliased the URL https://svgr-vmizzrixef.now.sh to the following alias.

Please sign in to comment.