Skip to content

Commit 2471b63

Browse files
AllesandriaAllesandria
authored andcommitted
server connected to project router
1 parent 6c48271 commit 2471b63

File tree

5 files changed

+44
-2
lines changed

5 files changed

+44
-2
lines changed

api/project/router.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,12 @@
11
// build your `/api/projects` router here
2+
const express = require('express');
3+
4+
const router = express.Router();
5+
6+
7+
8+
9+
10+
11+
12+
module.exports = router;

api/server.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,26 @@
22

33

44
const express = require('express');
5-
const router = express.Router();
5+
const server = express();
66

7+
server.use(express.json());
78

9+
const projectRouter = require('./project/router');
10+
server.use('/api/project', projectRouter);
811

12+
// const resourceRouter = require('./resource/router');
13+
// server.use('/api/resource', resourceRouter);
914

15+
// const taskRouter = require('./task/router');
16+
// server.use('/api/task', taskRouter);
1017

18+
//const router = express.Router();
1119

1220

1321

14-
module.exports = router;
22+
23+
24+
25+
26+
27+
module.exports = server;

knexfile.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ module.exports = {
1414
migrations: {
1515
directory: './data/migrations'
1616
}
17+
//seeds: {
18+
//directory: "./data/seeds",
19+
//},
1720
}
1821

1922
};

package-lock.json

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"dotenv": "^16.0.1",
2525
"env": "^0.0.2",
2626
"express": "^4.18.1",
27+
"helmet": "^5.1.1",
2728
"knex": "^2.2.0",
2829
"nodemon": "^2.0.19",
2930
"sqlite3": "^5.0.8"

0 commit comments

Comments
 (0)