Skip to content

sina-byn/express-rest-snippets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Express REST Snippets

The source code for this extension is available at https://github.com/sina-byn/express-rest-snippets.

Example

Initialize an express server with exp :

const express = require('express');

const app = express();

const port = process.env.PORT || 3000;

app.listen(port, () => {
  console.log(`Server running at http://localhost:${port}`);
});

Snippets

Snippet Description
exp initialize an express server
rtr initialize an express router
mid add an express middleware
rmid add an express router middleware
emid add an express error middleware
rt add an express route
ctrl add an express controller
res add an express response expression
sres add an express success response expression
eres add an express error response expression
ncres add an express no-content response expression

Enjoy!