Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const config = require("./config");
- const express = require("express");
- const bodyParser = require("body-parser");
- const morgan = require("morgan");
- const app = express();
- app.use(morgan("combined"));
- app.use(bodyParser.urlencoded({ extended: true }));
- app.use(bodyParser.json());
- app.get("/", (req, res) => {
- res.json({
- title: "API",
- message: "Welcome to API",
- code: 202
- });
- });
- app.listen(config.PORT, () => {
- console.log("Server listening");
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement