Hello World from OSS Silicon Valley
HowToUse/NodeJS/0.10/Express/4.14
_ Prerequisite
- NodeJS installation (You can refer HowToUse/NodeJS/0.10)
_ Install&Setup
- Step.1
- Install Express.
$ sudo npm install -g express $ sudo npm install -g express_generator
_ HowToUse
_ Create sample code with express
- Step.1
- Create a new project
$ mkdir <project name>
- Step.2
- Install express in you project directory.
$ cd <project name> $ npm init $ npm install express --save
- Step.3
- Place sample code in the directory. You can refer sample code from here.
- Step.4
- Launch HTTP server. Then you should access your application via http://<host IP>:<port num>/. If you use the sample code specified above, port number is 3000.
_ Create sample code with express-generator
- Step.1
- Create a new project
$ mkdir <project name>
- Step.2
- Install express and express-generator.
$ express -e <project name> $ cd <project name> $ npm install
- Step.3
- Place sample code in the directory. You can refer the sample code from here.
- Step.4
- Launch HTTP server.Then you should access your application via http://<host IP>:<port num>/. If you use the sample code specified above, port number is 3000.
_ Author
S.Yatsuzuka
[ back ]
Last-modified: 2016-11-23 (Wed) 06:57:49 (3012d)