Giter VIP home page Giter VIP logo

express-starter's Introduction

express starter

A simple server setup.

Usage

$ git clone https://github.com/robert52/express-starter.git
$ cd express-starter
$ npm install
$ cp config/environments/example.js config/environments/development.js

Modify configuration file accordingly.

To run the server us the following command, by default the server will run in development mode:

$ node server.js

Running tests

To run a test simple use the following command:

mocha tests/unit/password.js

Folder structure

app

The main application folder containing all the server files, based on MVC structure.

  • controllers: mostly will contain back-end business logic.
  • models: this is where you store all Mongoose models.
  • routes: Express routes will be found here. To include a route please see config/routes.js file.
  • views: application view files, swig is used as the default view engine.
  • helpers: helper functions used in the whole application, mainly units that can be tested stand-alone.
  • middlewares: mountable business logic on routes, connect style middleware.

config

The config folder contains files which configure different application parts.

  • environments: environment configuration files.
  • strategies: authentication strategies used by Passport.

public

The public folder contains static assets of the application. Usually you can mount this folder as the root of the application in nginx to serve the static files from there.

tests

The test folder stores the Mocha test suites.

  • unit: contains only unit tests.
  • integration: test suites that run on the whole application, or on modules that have dependencies.
  • fixtures: data that can be loaded into MongoDB for testing.

License

MIT

express-starter's People

Contributors

robert52 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

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.