IIssNan's Notes

Quick notes


  • 首页

  • 归档

  • 标签

  • 搜索

Watchers for express application development

发表于 2014-08-10 | | 阅读次数

There are brilliant tools that can leverage watch method from the core Node.js fs module and restart server when changes are made:

  • Supervisor
  • up
  • node-dev
  • nodemon

Bootstrap an express application

发表于 2014-08-09 | | 阅读次数

Things we perform in a express application’s entry point file:

  1. Import dependencies.
  2. Configurations. Such as the template engine.
  3. Define Middlewares.
  4. Define Routes.
  5. Connection to DB.
  6. Start the app.

Example:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Dependencies.
var expres = require('express');
var app = express();
// Configurations.
var port = process.env.PORT || 7654;
app.set('port', port);
app.set('view', __dirname + '/views');
// Middlewares.
app.use(express.favicon());
app.use(express.static(__dirname + '/public'));
app.use(express.bodyParser());
app.use(express.methodOverride());
app.use(express.session());
// Routes.
app.get('*', function (req, res) {
res.end('Hello World!');
});
// DB Connection.
// Start.
app.listen(port, function () {
console.log('Service is running on: ', port);
});

Explanation of angular module

发表于 2014-08-04 | | 阅读次数


From AngularJS Fundamentals in 60-ish Minutes

Shadow DOM 101

发表于 2014-08-02 | | 阅读次数

GitHub - Display images in the README

发表于 2014-08-01 | | 阅读次数

There are two ways to make GitHub rendering images in the README:

  • Using relative path. Append ?raw=true to the image uri:
1
![](path/to/image.png?raw=true)
  • Use the intact uri of the image in the GitHub repository:
1
![](https://github.com/username/reponame/blob/master/images/image.png)
1…131415…37
IIssNan

IIssNan

胡编一通,乱写一气

183 日志
6 分类
111 标签
RSS
GitHub Twitter 豆瓣 知乎
© 2011 - 2017 IIssNan
由 Hexo 强力驱动
主题 - NexT.Pisces
0%