Git Product home page Git Product logo

koa-boilerplate's Introduction

Koa-Boilerplate

A Koa v2 boilerplate for building restful API and view engine

Features

  • ES6/ES2015 support using Babel
  • Use MongoDB for the database and Mongoose ODM for schema creation
  • Use Bunyan for logging errors and events
  • Use Nodemon for watching and restarting
  • Use Nunjucks for rendering view
  • Use Jest as test framework (TODO)

Structure

.
├── bin
│   └── server.js            # entry of api server
├── src
│   │
│   ├── __test__             # testing scripts
│   ├── config               # app configurations
│   ├── controllers          # api implementations
│   ├── middlewares          # middleware implementations
│   │   └── query_parser.js  # mongoose connection service
│   ├── models               # database schema definitions
│   ├── servies              # standalone services
│   │   └── mongoose.js      # mongoose connection service
│   ├── routes.js            # router definitions
│   └── index.js             # koa instance
└── package.json

Usage

Setup

$ npm install

Run Server for Development

$ npm run dev

Assign a fixed port

$ npm run dev -- --port 8080

Run for Production

$ npm run build
$ npm run start

Assign a fixed port

$ npm run build
$ npm run start -- -- --port 8080

Test

$ npm test

License

MIT © Kenny-Chang

koa-boilerplate's People

Contributors

yo8568 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

davini-dev mernjs

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.