<commit_before>// reference for this tutorial;
// http://cwbuecheler.com/web/tutorials/2013/node-express-mongo/
// http://expressjs.com/en/starter/generator.html
// setting up / Installation
// 1. install node.js
// link -> https://nodejs.org/en/
// 2. install express generator, for mac users, add sudo in the front
// type the command below on the terminal, it is different from express.js. It creates a skeleton for using express.
// $(sudo)npm install -g express-generator

// start your app!
// these commands will create an app for you and install the packages
// $express appname
// $cd appname
// $(sudo)npm install

// To test if it worked
// start the server!
// $npm start

//structure
.
├── app.js
├── bin
│   └── www
├── package.json
├── public
│   ├── images
│   ├── javascripts
│   └── stylesheets
│       └── style.css
├── routes
│   ├── index.js
│   └── users.js
└── views
    ├── error.jade
    ├── index.jade
    └── layout.jade

// Basic routing
// http://expressjs.com/en/guide/routing.html
// in index.js / users.js
APP.MODULE(PATH, HANDLER FUNCTION)
// get : read
app.get('/', function(req, res, next) {
  res.render('index', { title: 'Express' });
});
// Other RESTful Services
// create
app.post('/', function (req, res) {
  res.send('Got a POST request');
});
// update, replace
app.put('/', function (req, res) {
  res.send('Got a PUT request');
});
// delete
app.delete('/', function (req, res) {
  res.send('Got a DELETE request');
});

//using static files (usually included in app.js) to include files in public like BOOTSTRAP!
app.use(express.static('public'));
app.use('/static', express.static(__dirname + '/public'));

// jade
// resource: http://jade-lang.com/
// similar to HTML but it's a template and accepts variable passing to it
// if you are more comfortable with HTML, you can try EJS by either specify when start the new project
// or npm install ejs, but make sure to change the engine in app.js
  // resource for ejs:
  // 1. $ (sudo)npm install ejs
  //    app.set('view engine', 'ejs');  in app.js
  // 2. $ express appname -ejs

//final notes:
  // The installation might be the hardest part, make sure your syntax correspond to the right version.
  // ask google anything, he is super friendly and helpful.<commit_msg>more explaination on template language<commit_after>// reference for this tutorial;
// http://cwbuecheler.com/web/tutorials/2013/node-express-mongo/
// http://expressjs.com/en/starter/generator.html
// setting up / Installation
// 1. install node.js
// link -> https://nodejs.org/en/
// 2. install express generator, for mac users, add sudo in the front
// type the command below on the terminal, it is different from express.js. It creates a skeleton for using express.
// $(sudo)npm install -g express-generator

// start your app!
// these commands will create an app for you and install the packages
// $express appname
// $cd appname
// $(sudo)npm install

// To test if it worked
// start the server!
// $npm start

//structure
.
├── app.js
├── bin
│   └── www
├── package.json
├── public
│   ├── images
│   ├── javascripts
│   └── stylesheets
│       └── style.css
├── routes
│   ├── index.js
│   └── users.js
└── views
    ├── error.jade
    ├── index.jade
    └── layout.jade

// Basic routing
// http://expressjs.com/en/guide/routing.html
// in index.js / users.js
APP.MODULE(PATH, HANDLER FUNCTION)
// get : read
app.get('/', function(req, res, next) {
  res.render('index', { title: 'Express' });
});
// Other RESTful Services
// create
app.post('/', function (req, res) {
  res.send('Got a POST request');
});
// update, replace
app.put('/', function (req, res) {
  res.send('Got a PUT request');
});
// delete
app.delete('/', function (req, res) {
  res.send('Got a DELETE request');
});

//using static files (usually included in app.js) to include files in public like BOOTSTRAP!
app.use(express.static('public'));
app.use('/static', express.static(__dirname + '/public'));

// jade
// resource: http://jade-lang.com/
// similar to HTML but it's a template and accepts variable passing to it
// if you are more comfortable with HTML, you can try EJS by either specify when start the new project
// or npm install ejs, but make sure to change the engine in app.js
  // resource for ejs:
  // 1. $ (sudo)npm install ejs
  //    app.set('view engine', 'ejs');  in app.js
  // 2. $ express appname -ejs
//usual structure of these files:
  // make a layout / heading .jade that is similar in all other pages
  // index.jade, where the main content is
  // footer.jade the footer

//final notes:
  // The installation might be the hardest part, make sure your syntax correspond to the right version.
  // ask google anything, he is super friendly and helpful.
{'fraction_non_alphanumeric': 0.15407344871253695, 'fraction_numerical': 0.0033769523005487546, 'mean_word_length': 3.08182601205857, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '1002854', 'n_tokens_mistral': 1536, 'n_tokens_neox': 1514, 'n_words': 587}