-
Notifications
You must be signed in to change notification settings - Fork 16
/
serve-static.express.txt
22 lines (16 loc) · 2.02 KB
/
serve-static.express.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
SERVE-STATIC
ALTERNATIVES ==> # - st:
# - handles things that can be done with other modules (CORS, filesystem cache, compression)
# - does not handle range requests
# - serve-static (preferred with Node): maintained by Express
# - deno file_server (preferred with Deno)
VERSION ==> #1.15.0
EXPRESS.static('DIR'[, OPTS]) #Connect MIDWR (not dependent on Express)
#Serve files using same logic as RES.sendFile('PATH'[, OPTS]) except:
# - 'DIR' -> OPTS.root
# - OPTS.headers OBJ -> OPTS.setHeaders(RES, 'PATH', FSSTAT)
#OPTS:
# - fallthrough BOOL (def: true): calls NEXT() if 4** (instead of NEXT(ERROR)) or not GET|HEAD
# - redirect BOOL (def: true): if 'DIR' and misses last '/', 404 instead of 301 redirect