Created
December 1, 2019 18:07
-
-
Save RizkyRajitha/ce35bd4f99e550f1bd42f28a52b93853 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 bp = require("body-parser"); | |
const port = 5000; | |
const app = express(); | |
app.use(bp.urlencoded({ extended: false })); | |
app.use(bp.json()); | |
app.use(require("morgan")("dev")); | |
app.get("/", (req, res) => { | |
var obj = { | |
name: "rizky" | |
}; | |
res.json(obj); | |
}); | |
app.listen(port, () => { | |
console.log("Express server listning on port " + port); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment