<commit_before># bootjs

A lightweight web framework based on Node.js and Express.js

![bootjs logo](https://github.com/guoguolong/bootjs/raw/master/docs/logo-300.png)

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.json
```
## Step 1: Dependencies Intallation.

>cnpm install express
>cnpm install bootjs

Or you can make a package.json as below:
``` json
{
  "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": "<NAME>",
  "license": "MIT",
  "dependencies": {
    "bootjs": "^0.1.5",
    "express": "^4.14.1"
  }
}
```

## Step 2: Edit config.js
``` javascript
'use strict';
module.exports = {
    baseDir: __dirname + '/app/src/' // Mandatory item.
}
```

## Step 3: Edit app.js

``` node
'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(); 
<commit_msg>fix bugs<commit_after># bootjs

A lightweight web framework based on Node.js and Express.js

![bootjs logo](https://github.com/guoguolong/bootjs/raw/master/docs/logo-300.png)

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.json
```
## Step 1: Dependencies Intallation.

>cnpm install express
>cnpm install bootjs

Or you can make a package.json as below:
``` json
{
  "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": "<NAME>",
  "license": "MIT",
  "dependencies": {
    "bootjs": "^0.1.6",
    "express": "^4.14.1"
  }
}
```

## Step 2: Edit config.js
``` javascript
'use strict';
module.exports = {
    baseDir: __dirname + '/app/src/' // Mandatory item.
}
```

## Step 3: Edit app.js

``` node
'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(); 

{'fraction_non_alphanumeric': 0.17512213453588876, 'fraction_numerical': 0.012777151446824501, 'mean_word_length': 3.5426621160409555, 'pattern_counts': {'":': 22, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5020658', 'n_tokens_mistral': 980, 'n_tokens_neox': 928, 'n_words': 269}