Commit 219d9609 authored by Thomas Heckmann's avatar Thomas Heckmann

adds json server

parent cce86542
{
"projects": [
{
"name": "Bahn 2020",
"customer": "Deutsche Bahn",
"pt": "100",
"city": "Frankfurt/Main"
},
{
"name": "Kaufland Next",
"customer": "Kaufland",
"pt": "160",
"city": "Heilbronn"
}
]
}
\ No newline at end of file
This diff is collapsed.
......@@ -7,7 +7,8 @@
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
"e2e": "ng e2e",
"server": "node server.js"
},
"private": true,
"dependencies": {
......@@ -29,12 +30,13 @@
"@angular/cli": "~7.1.3",
"@angular/compiler-cli": "~7.1.0",
"@angular/language-service": "~7.1.0",
"@types/node": "~8.9.4",
"@types/jasmine": "~2.8.8",
"@types/jasminewd2": "~2.0.3",
"@types/node": "~8.9.4",
"codelyzer": "~4.5.0",
"jasmine-core": "~2.99.1",
"jasmine-spec-reporter": "~4.2.1",
"json-server": "^0.14.0",
"karma": "~3.1.1",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
......
// server.js
const jsonServer = require('json-server');
const server = jsonServer.create();
const router = jsonServer.router('db.json');
const middlewares = jsonServer.defaults();
const port = 3000;
server.use(middlewares);
server.use(router);
server.listen(port, () => {
console.log('JSON Server is running on port ' + port);
});
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment