Skip to content

Instantly share code, notes, and snippets.

@tolulope-od
Created June 9, 2019 10:34
Show Gist options
  • Save tolulope-od/ec8e8a169c919630a3574469c179ecd3 to your computer and use it in GitHub Desktop.
Save tolulope-od/ec8e8a169c919630a3574469c179ecd3 to your computer and use it in GitHub Desktop.
Entry point for Node/Express app for testing
import express from 'express';
const port = process.env.PORT || 4000;
const app = express();
// This is where the magic happens.
// We write the case needed for our test to pass
app.get('/', (req, res) => {
res.status(200).json({
message: 'Hello Books'
});
});
app.listen(port, () => {
debug(`Server started on port ${port}`);
});
export default app;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment