Skip to content

Commit

Permalink
setup express along with morgan
Browse files Browse the repository at this point in the history
  • Loading branch information
Yashas Reddy committed Mar 19, 2020
1 parent 71c7819 commit a15af00
Show file tree
Hide file tree
Showing 5 changed files with 12,799 additions and 2 deletions.
15 changes: 15 additions & 0 deletions backend/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const express = require("express");
const morgan = require("morgan");

const app = express();

/* Loading Routes */
const authRoute = require("./routes/auth");

app.use(express.json());
app.use(express.urlencoded({ extended: true }));
app.use(morgan("tiny"));

app.use("/auth", authRoute);

app.listen(4000, () => console.log("Server started on port 4000"));
9 changes: 9 additions & 0 deletions backend/routes/auth.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const express = require("express");

const router = express.Router();

router.get("/", function (req, res) {
res.end("Success");
});

module.exports = router;
Loading

0 comments on commit a15af00

Please sign in to comment.