-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
24 lines (18 loc) · 761 Bytes
/
app.js
File metadata and controls
24 lines (18 loc) · 761 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
"use strict";
var express = require("express");
const bodyParser = require("body-parser");
var expressApp = express().use(bodyParser.json());
var Config = require("./config"),
port = process.env.PORT || Config.port,
ENV = process.env.NODE_ENV || Config.env
const DialogflowHandler = require("./app/handlers/dialogflowApp");
require("./config/mongoose")(expressApp)
// EXPRESS APP fulfillment route (POST). The entire dialogFlowApp object (incl its handlers) is the callback handler for this route.
expressApp.post("/", DialogflowHandler);
// EXPRESS APP test route (GET)
expressApp.get("/", (req, res) => {
res.send("CONFIRMED RECEIPT OF GET.");
});
expressApp.listen(port, () =>
console.log(`*** SERVER RUNNING LOCALLY ON PORT ${port} ***`)
);