Skip to content

Commit

Permalink
[Desktop] Enable CORS support
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasGaubert committed Sep 30, 2016
1 parent 53a9362 commit a980f0c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions desktop/app/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ const uuid = conf.get('uuid')
// Networking
var bodyParser = require('body-parser')
var web = require('express')()
web.use(function(req, res, next) {
res.header("Access-Control-Allow-Origin", "*")
res.header("Access-Control-Allow-Headers", "X-Requested-With")
res.header("Access-Control-Allow-Headers", "Content-Type")
res.header("Access-Control-Allow-Methods", "PUT, GET, POST, DELETE, OPTIONS")
next()
})
web.use(bodyParser.urlencoded({ extended: false }))
web.use(bodyParser.json())
var http = require('http').Server(web)
Expand Down

1 comment on commit a980f0c

@dkoppel
Copy link

@dkoppel dkoppel commented on a980f0c Oct 7, 2016

Choose a reason for hiding this comment

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

I finally got around to getting a full test/dev env set up for zephyr (I started with the overlay, not realizing that the API was part of the main app until after figuring out the QT build system). You beat me to implementing this, but at least I'm now equipped to help test! I can confirm that this commit satisfies issue #28.

Please sign in to comment.