File tree 4 files changed +29
-16
lines changed
4 files changed +29
-16
lines changed Original file line number Diff line number Diff line change
1
+ {
2
+ "extends" : [" node" , " prettier" ],
3
+ "env" : {
4
+ "node" : true ,
5
+ "browser" : true ,
6
+ "commonjs" : false
7
+ },
8
+ "rules" : {
9
+ "import/no-commonjs" : 0 ,
10
+ "no-console" : 0 ,
11
+ "import/no-nodejs-modules" : 0
12
+ }
13
+ }
Original file line number Diff line number Diff line change @@ -58,6 +58,7 @@ typings/
58
58
59
59
# dotenv environment variables file
60
60
.env
61
+ config.env
61
62
62
63
# next.js build output
63
64
.next
Original file line number Diff line number Diff line change 5
5
"main" : " index.js" ,
6
6
"dependencies" : {
7
7
"env2" : " ^2.2.2" ,
8
+ "eslint" : " ^5.3.0" ,
9
+ "eslint-config-node" : " ^3.0.0" ,
10
+ "eslint-config-prettier" : " ^2.9.0" ,
8
11
"pg" : " ^7.4.3"
9
12
},
10
13
"devDependencies" : {
11
14
"codecov" : " ^3.0.4" ,
12
15
"eslint" : " ^5.3.0" ,
16
+ "istanbul" : " ^0.4.5" ,
13
17
"jest" : " ^23.4.2" ,
14
18
"nodemon" : " ^1.18.3" ,
15
19
"nyc" : " ^12.0.2" ,
30
34
"bugs" : {
31
35
"url" : " https://github.com/sunuwars/DJES/issues"
32
36
},
33
- "homepage" : " https://github.com/sunuwars/DJES#readme"
37
+ "homepage" : " https://github.com/sunuwars/DJES#readme" ,
38
+ "directories" : {
39
+ "test" : " test"
40
+ }
34
41
}
Original file line number Diff line number Diff line change 1
- const http = require ( 'http' ) ;
2
- const fs = require ( 'fs' ) ;
3
- const handlers = require ( './handlers' ) ;
4
-
5
- // check why we've put this here
6
- const pg = require ( 'pg' ) ;
7
-
8
- const queryString = require ( 'querystring' ) ;
1
+ const handlers = require ( "./handlers" ) ;
9
2
10
3
const router = ( req , res ) => {
11
- const endpoint = req . url . split ( '/' ) [ 1 ] ;
4
+ const endpoint = req . url . split ( "/" ) [ 1 ] ;
12
5
13
- if ( endpoint === '' ) {
6
+ if ( endpoint === "" ) {
14
7
handlers . home ( req , res ) ;
15
- } else if ( endpoint === ' search' ) {
8
+ } else if ( endpoint === " search" ) {
16
9
handlers . search ( req , res ) ; // some arguments maybe
17
- } else if ( endpoint === ' request-item' ) {
10
+ } else if ( endpoint === " request-item" ) {
18
11
handlers . requestItem ( ) ; // some arguments
19
- } else if ( endpoint === ' add-item' ) {
12
+ } else if ( endpoint === " add-item" ) {
20
13
handlers . addItem ( ) ; // some arguments
21
14
} else {
22
15
handlers . public ( req , res , endpoint ) ;
23
16
}
24
-
25
- }
17
+ } ;
26
18
27
19
module . exports = router ;
You can’t perform that action at this time.
0 commit comments