Skip to content

Instantly share code, notes, and snippets.

@treyhuffine
Created December 31, 2019 01:17
Show Gist options
  • Save treyhuffine/b3e6d25d956ba81bdb8c3cae5e2893fd to your computer and use it in GitHub Desktop.
Save treyhuffine/b3e6d25d956ba81bdb8c3cae5e2893fd to your computer and use it in GitHub Desktop.
import express from 'express';
import { rootHandler, helloHandler } from './handlers';
const app = express();
const port = process.env.PORT || '8000';
app.get('/', rootHandler);
app.get('/hello/:name', helloHandler);
app.listen(port, err => {
if (err) return console.error(err);
return console.log(`Server is listening on ${port}`);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment