최은석

Node of Hello World tutorial

1 +var express = require('express');
2 +var app = express();
3 +app.get('/', function (req, res) {
4 + res.send('Hello World');
5 +})
6 +
7 +var server = app.listen(80, function () {
8 + var host = server.address().address
9 + var port = server.address().port
10 + console.log("Example app listening at http://%s:%s", host, port)
11 +})
12 +
This diff is collapsed. Click to expand it.
1 +{
2 + "name": "helloworld",
3 + "version": "1.0.0",
4 + "description": "",
5 + "main": "index.js",
6 + "scripts": {
7 + "test": "echo \"Error: no test specified\" && exit 1"
8 + },
9 + "author": "",
10 + "license": "ISC",
11 + "dependencies": {
12 + "express": "^4.15.2"
13 + }
14 +}