Skip to content

Instantly share code, notes, and snippets.

@rikkrome
Created July 6, 2018 07:36
Show Gist options
  • Save rikkrome/be03a6c4710d90942abf621426b56de4 to your computer and use it in GitHub Desktop.
Save rikkrome/be03a6c4710d90942abf621426b56de4 to your computer and use it in GitHub Desktop.
simple express.js
// 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