File tree 3 files changed +12
-11
lines changed 3 files changed +12
-11
lines changed Original file line number Diff line number Diff line change 2
2
3
3
## Unreleased
4
4
5
+ * Disable logging for static content requests
5
6
* Remove bad ` console.log `
6
7
* Update dependencies
7
8
* Use [ ` nanoid ` ] ( https://github.com/ai/nanoid )
Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ Start JSON Server
89
89
$ json-server --watch db.json
90
90
```
91
91
92
- Now if you go to [ http://localhost:3000/posts/1 ] ( ) , you'll get
92
+ Now if you go to [ http://localhost:3000/posts/1 ] ( http://localhost:3000/posts/1 ) , you'll get
93
93
94
94
``` json
95
95
{ "id" : 1 , "title" : " json-server" , "author" : " typicode" }
Original file line number Diff line number Diff line change @@ -22,16 +22,6 @@ module.exports = function(opts) {
22
22
arr . push ( compression ( ) )
23
23
}
24
24
25
- // Logger
26
- if ( opts . logger ) {
27
- arr . push (
28
- logger ( 'dev' , {
29
- skip : req =>
30
- process . env . NODE_ENV === 'test' || req . path === '/favicon.ico'
31
- } )
32
- )
33
- }
34
-
35
25
// Enable CORS for all the requests, including static files
36
26
if ( ! opts . noCors ) {
37
27
arr . push ( cors ( { origin : true , credentials : true } ) )
@@ -45,6 +35,16 @@ module.exports = function(opts) {
45
35
// Serve static files
46
36
arr . push ( express . static ( opts . static ) )
47
37
38
+ // Logger
39
+ if ( opts . logger ) {
40
+ arr . push (
41
+ logger ( 'dev' , {
42
+ skip : req =>
43
+ process . env . NODE_ENV === 'test' || req . path === '/favicon.ico'
44
+ } )
45
+ )
46
+ }
47
+
48
48
// No cache for IE
49
49
// https://support.microsoft.com/en-us/kb/234067
50
50
arr . push ( ( req , res , next ) => {
You can’t perform that action at this time.
0 commit comments