Giter VIP home page Giter VIP logo

easyexpress's Introduction

Easy Express

Here is an example with mongoose.

Conventions

For each main route you must have a router.js file. Other files aren't required but a controller.js is recommended, it can be a class or a object with functions, as you want... Finally for this example there is a model.js file for mongoose, it defines my data model, the file is required in the controller.js file to manage data.
You can also use a middleware.js file to define middlewares

How it works

The api/index.js automatically import middlewares, and routes from your main route folder. In this example there is a folder named example, you can access the routes with http://localhost:4000/api/example/routeName

Defining routes

You have two ways to define a route; with a list or an object. An example can be found in api/example/router.js

Defining middlewares

A middleware.js file export an object with two properties, before and after, each property is a list of functions.

easyexpress's People

Contributors

owengombas avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

danydacosta

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.