Skip to content

Commit

Permalink
Modified DataServer
Browse files Browse the repository at this point in the history
Added DataServer to set Response Headers.
  • Loading branch information
nehakadam committed May 31, 2016
1 parent 5401f12 commit c7097b8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions DataServer/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ app.get('/slotavailability', routes.slotavailability);
app.get('/filtercriteria', routes.filtercriteria);
app.get('/misc', routes.misc);

app.all('*', function(req, res, next) {
res.header("Access-Control-Allow-Origin", "*");// restrict it to the required domain
res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE,OPTIONS');
// Set custom headers for CORS
res.header('Access-Control-Allow-Headers', 'Content-type,Accept,X-Access-Token,X-Key');
next();
});

app.listen(3000, function()
{
console.log("Express server listening on port 3000");
Expand Down
2 changes: 1 addition & 1 deletion doc/js/CalenStyleData.js
Original file line number Diff line number Diff line change
Expand Up @@ -1531,7 +1531,7 @@ var documentation = {
},
{
"version": "2.0.3",
"date": "May 30, 2016",
"date": "May 31, 2016",
"description": "Added Documentation for DataServer and examples of loading Data from URL. demo/Data-URL.htm and demo/Mobile/Data-URL.htm"
}
]
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

"homepage": "https://curioussolutions.in/libraries/calenstyle",

"main": ["dist/calenstyle.min.js", "dist/calenstyle.min.css"],
"main": "dist/calenstyle.min.js",

"bugs": {

Expand Down

0 comments on commit c7097b8

Please sign in to comment.