Skip to content

Instantly share code, notes, and snippets.

@RizkyRajitha
Created December 1, 2019 18:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RizkyRajitha/ce35bd4f99e550f1bd42f28a52b93853 to your computer and use it in GitHub Desktop.
Save RizkyRajitha/ce35bd4f99e550f1bd42f28a52b93853 to your computer and use it in GitHub Desktop.
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