Nodejs Snippets
Github : https://github.com/abdoseadaa/node-js-snippets.git
No |
snippet |
what it does |
1 |
req |
creates require statement with same args |
2 |
ar |
creates liner arrow function |
3 |
arp |
creates arrow function with params |
4 |
arp.as |
creates async arrow function with params |
5 |
app.req |
creates require statement with different args |
6 |
app |
creates express server |
7 |
app.mvc |
creates express server with view engine |
8 |
app.get |
creates app.get middleware |
9 |
app.post |
creates app.post middleware |
10 |
app.log |
creates a bit formatted logger |
11 |
app.mid |
creates middleware function |
12 |
app.mid.as |
creates async middleware function |
13 |
app.cont.as |
creates async controller function |
14 |
app.cont |
creates controller function |
15 |
app.router |
creates express router |
16 |
app.200 |
creates ok 200 server response |
17 |
app.404 |
creates not ok 404 server response |
18 |
app.403 |
creates forbidden 403 server response |
19 |
app.render |
creates rendered response |
20 |
app.render.params |
creates rendered response with parameters |
21 |
app.view |
set server's view engine |
22 |
app.static |
serve express static files |
23 |
app.parse |
parse request body |
24 |
app.connect |
connect to to mongoDB |
25 |
app.model |
creates mongoDB model |
26 |
app.doc |
creates new mongodb document |
| |