add tracks main page. add get my tracks action

This commit is contained in:
Dzmitry_Tamashevich@epam.com
2020-10-08 11:17:06 +03:00
committed by Daniel Hutzel
parent 0f6444589f
commit bdbd9d425b
28 changed files with 381 additions and 8 deletions

31
media-store/server.js Normal file
View File

@@ -0,0 +1,31 @@
const cds = require("@sap/cds");
// handle bootstrapping events...
cds.on("bootstrap", (app) => {
// dev only
app.use((req, res, next) => {
res.header("Access-Control-Allow-Origin", "*");
res.header(
"Access-Control-Allow-Methods",
"GET, PUT, POST, DELETE, OPTIONS"
);
res.header(
"Access-Control-Allow-Headers",
"Origin, X-Requested-With, Content-Type, Accept, Authorization"
);
//intercepts OPTIONS method
if ("OPTIONS" === req.method) {
//respond with 200
res.sendStatus(200);
} else {
//move on
next();
}
});
// add your own middleware before any by cds are added
});
cds.on("served", () => {
// add more middleware after all CDS servies
});
// delegate to default server.js:
module.exports = cds.server;