Koahub.js can be run stably in node. JS Environment with Babel compilation

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.