Created
December 22, 2017 10:13
-
-
Save Dakuan/3be2158a39c7acbdca053c036bb92e3e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require("express") | |
const moment = require("moment") | |
const app = express() | |
app.get("/api/expected-date/:invoiceId", (req, res) => { | |
const invoiceId = parseInt(req.params.invoiceId) | |
// ¯\_(ツ)_/¯ | |
const bump = Math.floor(Math.random() * 10) + 1 | |
const expectedDate = moment().add(bump, 'days').toISOString() | |
res.json({ | |
invoiceId, | |
expectedDate | |
}) | |
}) | |
const port = process.env.PORT || 8080 | |
app.listen(port, () => { | |
console.log(`invoices_svc listening on ${port}`) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment