forked from hailiang-wang/hanlp-api
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapp.js
More file actions
30 lines (25 loc) · 696 Bytes
/
app.js
File metadata and controls
30 lines (25 loc) · 696 Bytes
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
28
29
30
/**
*
* @authors chandre (chandre21cn@gmail.com)
* @date 2017-04-09 21:01:20
* @version $Id$
*/
const express = require('express');
const bodyParser = require('body-parser');
const app = express();
let router = require("./router");
// 收藏图标
app.get("/favicon.ico", (req, res) => {
res.send("");
});
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));
app.use("/" , router )
let config = require("./config")
// 启动HTTP服务
let server = app.listen({
port : config.port || 3000,
host : config.host || "0.0.0.0"
}, () => {
console.log('HanLP Service listening at http://%s:%s', server.address().address, server.address().port);
});