Package Exports
- bootjs
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (bootjs) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
bootjs
A lightweight web framework based on Node.js and Express.js

Below is a minimal bootjs web application. Suppose we have a project named 'hello', here is the project folder layout:
[app]
|_config.js // configuration file.
|_[src]
| |_ [controllers]
| |_ IndexController.js
app.js // bootstrap file.
package.jsonStep 1: Dependencies Intallation.
cnpm install express cnpm install bootjs
Or you can make a package.json as below:
{
"name": "hello",
"version": "1.0.0",
"description": "minimal web project based on bootjs ",
"main": "app.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Allen Guo",
"license": "MIT",
"dependencies": {
"bootjs": "^0.1.5",
"express": "^4.14.1"
}
}Step 2: Edit config.js
'use strict';
module.exports = {
baseDir: __dirname + '/app/src/' // Mandatory item.
}Step 3: Edit app.js
'use strict';
const express = require('express');
const app = express();
const Bootjs = require('bootjs');
const config = require('./config.js');
const bootjs = Bootjs(app, config);
// 初始化bootjs
bootjs.init();
// 添加bootjs的路由规则.
bootjs.addRoutes();
app.listen(5000, () => {
console.log('A http server started at localhost:5000.');
}); Step 4: Write a sample.
Create a app/src/IndexController.js as below:
'use strict';
module.exports = class {
index() {
this.res.end('Hello Bootjs');
}
}Start boojs server and access page.
Enter project folder then run
node app.js
Go to browser and input http://localhost:5000, you will got a page that show 'Hello Bootjs'.