An object-oriented efficient MVC and REST framework
CandyJs is a new framework and it is not based on the third party framework
Why CandyJs
DOC
Version of Node.js
nodejs >= 10.0
Quick start
npm install -g @candyjs/cli
candyjs-cli
Hello world
CandyJs application start with an entry file
import '@candyjs/tswrapper';
import CandyJs from 'candyjs';
import App from 'candyjs/web/Application';
new CandyJs(new App({
'id': 1,
'debug': true,
'appPath': __dirname + '/app'
})).listen(2333, () => {
console.log('listen on 2333');
});
Alias
-
@candy the directory where the Candy.ts file is located
-
@app the base path of the running application
-
@runtime the runtime path of the running application. Defaults to @app/runtime
Application structure example
|- index.ts
|
|- node_modules
|
|- public
|
|- app
| |
| |-- controllers
| |
| |-- user
| | |
| | |-- IndexController.ts
| | |-- OtherController.ts
| |
| |-- goods
| | |
| | |-- IndexController.ts
| | |-- OtherController.ts
| |
| -- views
| |
| |-- user
| | |
| | |-- index.html
| | |-- other.html
| |
| -- goods
| | |
| | |-- index.html
| | |-- other.html
| |
| -- modules
| |
| |-- actives
| | |
| | |-- controllers
| | | |
| | | |-- IndexController.ts
| | |
| | |-- views
| | | |
| | | |-- index.html
| | |
| |
| -- runtime
|