forked from dapr/samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
22 lines (18 loc) · 764 Bytes
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// ------------------------------------------------------------
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
// ------------------------------------------------------------
const express = require('express');
const bodyParser = require('body-parser');
require('isomorphic-fetch');
const app = express();
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));
const port = 3000;
app.post('/neworder', bodyParser.json(), (req, res) => {
const data = req.body.data;
const orderId = data.orderId;
console.log("Got a new order! Order ID: " + orderId);
res.status(200).send("Got a new order! Order ID: " + orderId);
});
app.listen(port, () => console.log(`Node App listening on port ${port}!`));