Koahubjs
Koahub.js--node. JS Web Rapid Development framework based on the Koa.js platform. Features such as ES6/7 (Generator Function, Class, Async & Await) can be directly used in the project and can be run stably on the node. JS Environment with Babel compilation.
Introduced
Koahub.js--node. JS Web Rapid Development framework based on the Koa.js platform. Features such as ES6/7 (Generator Function, Class, Async & Await) can be directly used in the project and can be run stably on the node. JS Environment with Babel compilation.
Base controller, Admin/controller/base.controller.js export default class extends koahub.http{ constructor () { super (); Console.log (' base constructor '); } IsLogin () { console.log (' base islogin '); }//index Controller, admin/controller/index.controller.js Import Base from "./base.controller"; Export default class extends base{ constructor () { super (); Console.log (' index constructor '); } Index () { super.islogin (); Super.json ({msg: ' This is a msg '}); Console.log (' index index ');} }
All of the features in ES6/7 can be used in the project, and Babel can be compiled to run stably in the >=0.12.0 node. JS environment.
Characteristics
- Support KOA All middleware
- Support for developing projects using es2015+ all features
- Support Breakpoint Debugging es2015+ Project
- Supports multiple project structures and multiple project environments
- Support multi-level Controller
- Support for automatic loading
- ...
Installation
NPM Install KOAHUBJS--save
Create a startup file
Create Start.js startup file var Koahub = require ("Koahubjs");
//Default app is project directory
Const APP = new Koahub.default (); App.getkoa (); Get KOAHUBJS instantiation, support custom KOA middleware App.run (3000);
Directory structure//Recommended directory structure
App--addon--config--controller--data--model--utilnode_ Modulessrc--addon--config--controller--data--model--utilpackage.jsonstart.js
Start applyingnode Start.js
Startup information:
server running at http://127.0.0.1:3000 Document
In production ....
Website
[http://js.koahub.com]http://js.koahub.com
Koahub.js can be run stably in node. JS Environment with Babel compilation