Home >php教程 >php手册 >Nodejs web quick start -- KoaHub.js

Nodejs web quick start -- KoaHub.js

WBOY
WBOYOriginal
2016-09-19 08:53:221093browse

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 used directly in the project. With Babel compilation, it can run stably in the Node.js environment.
Introduction

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 used directly in the project. With Babel compilation, it can run stably in the Node.js environment. //base controller, admin/controller/base.controller.js<br> export default class extends koahub.http{<br> <br> ​​constructor() {<br>          super();<br> console.log('base constructor');<br> }<br> <br> ​​isLogin(){<br> console.log('base isLogin');<br> }<br> }<br> <br> //index controller, admin/controller/index.controller.js<br> import base from "./base.controller";<br> export default class extends base{<br> <br> ​​constructor() {<br>          super();<br> console.log('index constructor');<br> }<br> <br> index() {<br>            super.isLogin();<br>          super.json({msg: 'this is a msg'});<br> console.log('index index');<br> }<br> }All features in ES6/7 can be used in the project. With the help of Babel compilation, it can run stably in the Node.js environment of >=0.12.0.

Features

Support all koa middleware
Supports using all features of ES2015+ to develop projects
Supports breakpoint debugging of ES2015+ projects
Supports multiple project structures and multiple project environments
Support multi-level Controller
Support MySQL database
...
Download

git clone https://github.com/einsqing/koahubjs.git
Install dependencies

cd koahubjs
npm install
Start applying

npm run compile
npm run start
Startup information:

server running at http://127.0.0.1:3000
Documentation

In production....

Official website

[http://js.koahub.com]http://js.koahub.com

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn