File tree Expand file tree Collapse file tree 2 files changed +18
-12
lines changed Expand file tree Collapse file tree 2 files changed +18
-12
lines changed Original file line number Diff line number Diff line change
1
+ 'use strict' ;
2
+
3
+ var express = require ( 'express' ) ;
4
+
5
+ var router = express . Router ( ) ;
6
+
7
+ router . get ( '/todos' , function ( req , res ) {
8
+ res . json ( { todos : [ ] } ) ;
9
+ } ) ;
10
+
11
+ // TODO: Add POST route to create new entries
12
+
13
+ // TODO: Add PUT route to update existing entries
14
+
15
+ // TODO: Add DELETE route to remove existing entries
16
+
17
+ module . exports = router ;
Original file line number Diff line number Diff line change 1
1
'use strict' ;
2
2
3
3
var express = require ( 'express' ) ;
4
+ var router = require ( './api' ) ;
4
5
5
6
var app = express ( ) ;
6
7
7
8
app . use ( '/' , express . static ( 'public' ) ) ;
8
9
9
- var router = express . Router ( ) ;
10
-
11
- router . get ( '/todos' , function ( req , res ) {
12
- res . json ( { todos : [ ] } ) ;
13
- } ) ;
14
-
15
- // TODO: Add POST route to create new entries
16
-
17
- // TODO: Add PUT route to update existing entries
18
-
19
- // TODO: Add DELETE route to remove existing entries
20
-
21
10
app . use ( '/api' , router ) ;
22
11
23
12
app . listen ( 3000 , function ( ) {
You can’t perform that action at this time.
0 commit comments