-
Notifications
You must be signed in to change notification settings - Fork 105
Expand file tree
/
Copy pathapp.js
More file actions
35 lines (26 loc) · 800 Bytes
/
Copy pathapp.js
File metadata and controls
35 lines (26 loc) · 800 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
31
32
33
34
35
import express from "express";
import { config } from "dotenv";
import debug from "./comm/debug.js";
import bodyParser from 'body-parser';
import bodyParserXml from 'body-parser-xml';
import { initAccessToken } from "./comm/accesstoken.js";
import conversation from "./route/conversation.js";
config();
bodyParserXml(bodyParser);
const app = express();
const PORT = process.env.PORT;
/*message.log();*/
/*config parser for body*/
app.use(express.json());
app.use(express.urlencoded({ extended: false }));
app.use(bodyParser.xml());
/*health check for render*/
app.get('/healthz', function (req, res, next) {
res.status(200).end();
});
app.use('/message',conversation);
/*init access_token*/
initAccessToken();
app.listen(PORT, () => {
debug.out(`Server Running on Port:${PORT}`);
});