Created
July 6, 2018 07:36
-
-
Save rikkrome/be03a6c4710d90942abf621426b56de4 to your computer and use it in GitHub Desktop.
simple express.js
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
// server.js file | |
const express = require('express'); | |
const mongoose = require('mongoose'); | |
const app = express(); | |
// | |
// ─── ROUTES ───────────────────────────────────────────────────────────────────── | |
// | |
app.get('/', (req, res) => { | |
res.send("Hello World"); | |
}); | |
// | |
// ─── RUN SERVER ───────────────────────────────────────────────────────────────── | |
// | |
const port = process.env.PORT || 5000; | |
app.listen(port, () => console.log(`server running on port ${port}`)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment