<commit_before># SNOWF
a simple nodeJS web framework

## get start
1. npm install snowframework --save
1. create appsetting.json in root dir, refer to following example
1. create following dir: controller, views, wwwroot
1. create new controller in controller dir and create new index.html in views dir
1. cteate index.js in root dir, refer to following example
1. excute node index.js

## index.js example

``` js
//require snowframework
const snowf = require('snowframework');
const appsetting = require('./appsetting');

//init with appsetting.json
var app = snowf(appsetting.snowf);
//add controller
app.addController('home', require('./controllers/homeController'));
app.addController('docs', require('./controllers/docsController'));
//start app
app.start();
```

## appsetting.json example
this file need snowf node
```json
{
    "snowf": {
        "environment": "development",  //set the environment, if 'development', you will recive the debug info, else it will show the custom error page
        "port": "8089",
        "router": {
            "default": "home", //default page
            "error": "/shared/error.html", //custom error page
            "views": "./views", //views dir
            "root": "./wwwroot" //static resouce dir
        }
    }
}
```<commit_msg>更新readme<commit_after># SNOWF
a simple nodeJS web framework

## get start
1. npm install snowframework --save
1. create appsetting.json in root dir, refer to following example
1. create following dir: controller, views, wwwroot
1. create new controller in controller dir and create new index.html in views dir
1. cteate index.js in root dir, refer to following example
1. excute node index.js

## index.js example

``` js
//require snowframework
const snowf = require('snowframework');
const appsetting = require('./appsetting');

//init with appsetting.json
var app = snowf(appsetting.snowf);
//add controller
app.addController('home', require('./controllers/homeController'));
app.addController('docs', require('./controllers/docsController'));
//start app
app.start();
```

## appsetting.json example
this file need snowf node
```json
{
    "snowf": {
        "environment": "development", 
        "port": "8089",
        "router": {
            "default": "home", 
            "error": "/shared/error.html", 
            "views": "./views", 
            "root": "./wwwroot" 
        }
    }
}
```
environment : set the environment, if 'development', you will recive the debug info, else it will show the custom error page

port : the server port

default : default page

error : custom error page

views : views dir

root : static resouce dir
{'fraction_non_alphanumeric': 0.12775665399239544, 'fraction_numerical': 0.0076045627376425855, 'mean_word_length': 3.3344316309719932, 'pattern_counts': {'":': 16, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, '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': '6375170', 'n_tokens_mistral': 753, 'n_tokens_neox': 729, 'n_words': 281}