Skip to content

Commit

Permalink
Merge pull request r03ert0#58 from neuroanatomy/server2
Browse files Browse the repository at this point in the history
fix issue preventing to save annotations
  • Loading branch information
katjaq authored Feb 25, 2022
2 parents 804e2a6 + d1ff931 commit e15caf6
Show file tree
Hide file tree
Showing 19 changed files with 2,369 additions and 2,329 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
"env": {
"browser": true,
"es2017": true,
"es2018": true,
"node": true,
"mocha": true
},
Expand Down
16 changes: 15 additions & 1 deletion app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,21 @@ const start = async function () {
});


// CORS
app.use(function (req, res, next) {
// Website you wish to allow to connect
res.setHeader('Access-Control-Allow-Origin', '*'); // 'http://localhost:8888');
// Request methods you wish to allow
res.setHeader('Access-Control-Allow-Methods', 'GET, POST, OPTIONS, PUT, PATCH, DELETE');
// Request headers you wish to allow
res.setHeader('Access-Control-Allow-Headers', 'X-Requested-With,content-type');
// Set to true if you need the website to include cookies in the requests sent
// to the API (e.g. in case you use sessions)
res.setHeader('Access-Control-Allow-Credentials', true);
// Pass to next layer of middleware
next();
});

// uncomment after placing your favicon in /public
//app.use(favicon(path.join(__dirname, 'public', 'favicon.ico')));
if (process.env.NODE_ENV !== 'production') {
Expand All @@ -106,7 +121,6 @@ const start = async function () {
app.use(bodyParser.urlencoded({ limit: '50mb', extended: true }));
app.use(express.static(path.join(__dirname, 'public')));


/* setup DB */
// var checkAnyoneUser = function () {

Expand Down
Loading

0 comments on commit e15caf6

Please sign in to comment.