1.3.0 • Published 4 years ago

express-power-up v1.3.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

Demo

About express-power-up-snippets

Install

Install with VScode:

To install the extension, open the Extensions view on sidenav, search for express power up to filter results and select Express power up Snippets authored by Frani.

Install with Terminal:

code --install-extension frani.express-power-up

in case you have code command disable see this link to enable it

Following Project Structure

These snippets are thought to apply on ExpressJS with the next folder structure

FolderSuffix Extentiondescription
/config*.conf.jsEnvironment variables and configuration related things
/routers*.router.jsRouters
/controllers*.controller.jsroute controller ( controller layer)
/services*.service.jsbusiness logic, incluye intertal or externla servicies as SDK (service layer)
/middlewares*.mid.jscustom express middlewares
/validations*.validation.jsRequest data validation schemas
/schemas*.schema.jsMongoose models/schemas (data layer)
/dbs*.db.jsFunction to manage Mongoose schemas
/helpers*.helper.jsHelpful functions that can be used in many places but is not necesary a business logic
/tests*.test.jswell... just tests for your API

also http response follow the next structure:

// Example:
// GET /v1/users/frani
{
  "success": true,
  "message": "User @frani found",
  "body": {
    "name": "frani",
    "email": "hi@frani.me",
    "github": "https://github.com/frani"
  }
}

Snippets

Application Snippets

SnippetDescription
ep-appApp Variable
ep-app-allAll HTTP Requests
ep-app-getHTTP GET Requests
ep-app-postHTTP POST Requests
ep-app-putHTTP PUT Requests
ep-app-deleteHTTP DELETE Requests
ep-app-patchHTTP PATCH Requests
ep-app-disableApp Disable
ep-app-disabledApp Disabled
ep-app-enableApp Enable
ep-app-enabledApp Enabled
ep-app-engineApp Engine
ep-app-paramApp Param
ep-app-pathApp Path
ep-app-renderApp Render
ep-app-routeApp Route
ep-app-setApp Set
ep-app-listenApp Listen
ep-app-listen-with-callbackApp Listen With Callback
ep-app-useApp Use

Examples Snippets

SnippetDescription
ep-example-helloworldHello World
ep-example-controller*.controller.js
ep-example-service*.service.js
ep-example-db*.db.js
ep-example-helper*.helper.js
ep-example-middleware*.mid.js
ep-example-router*.router.js
ep-example-schema*.schema.js
ep-example-validation*.validation.js

The other example snippets are preparing...

Handlers Snippets

SnippetDescription
ep-404-handler404 - Not Found
ep-500-handler500 - Error

Middleware Snippets

SnippetDescription
ep-mid-helmetMiddleware Helmet
ep-mid-morganMiddleware Morgan
ep-mid-compressMiddleware Compression
ep-mid-body-parser-jsonMiddleware Body Parser Json
ep-mid-body-parser-urlMiddleware Body Parser Url Encoded
ep-mid-method-overrideMiddleware Method Override
ep-mid-static-fileMiddleware Static File

Module Snippets

SnippetDescription
ep-requireRequire ExpressJs 4 Module or Another Module
ep-namespaceExpressJs 4 Namespace

Request Snippets

SnippetDescription
ep-req-acceptsRequest Accepts
ep-req-accepts-charsetsRequest Accepts Charsets
ep-req-accepts-languagesRequest Accepts Languages
ep-req-getRequest Get
ep-req-isRequest Is
ep-req-rangeRequest Range

Response Snippets

SnippetDescription
ep-res-appendResponse Append
ep-res-attachmentResponse Attachment
ep-res-cookieResponse Cookie
ep-res-cookie-with-optionsResponse Cookie With Options
ep-res-clear-cookieResponse Clear Cookie
ep-res-clear-cookie-with-optionsResponse Clear Cookie With Options
ep-res-downloadResponse Download
ep-res-endResponse End
ep-res-formatResponse Format
ep-res-getResponse Get
ep-res-jsonResponse Json
ep-res-jsonpResponse Jsonp
ep-res-linksResponse Links
ep-res-locationResponse Location
ep-res-redirectResponse Redirect
ep-res-redirect-with-statusResponse Redirect With Status
ep-res-renderResponse Render
ep-res-sendResponse Send
ep-res-send-fileResponse Send File
ep-res-send-statusResponse Send Status
ep-res-setResponse Set
ep-res-statusResponse Status
ep-res-rssResponse Rss
ep-res-typeResponse Type
ep-res-varyResponse Vary

Router Snippets

SnippetDescription
ep-routerExpressJs 4 Router Variable
ep-router-allRouter All
ep-router-getRouter GET
ep-router-postRouter POST
ep-router-putRouter PUT
ep-router-deleteRouter DELETE

Test Snippets

SnippetDescription
ep-test-describe-getCreate Describe and 'it' with GET method
ep-test-describe-postCreate Describe and 'it' with POST method
ep-test-describe-putCreate Describe and 'it' with PUT method
ep-test-describe-deleteCreate Describe and 'it' with DELETE method
ep-test-it-getCreate 'it' test with GET method
ep-test-it-postCreate 'it' test with POST method
ep-test-it-putCreate 'it' test with PUT method
ep-test-it-deleteCreate 'it' test with DELETE method

Contributors

Inspiration

License

MIT © Frani