Created
June 9, 2019 10:34
-
-
Save tolulope-od/ec8e8a169c919630a3574469c179ecd3 to your computer and use it in GitHub Desktop.
Entry point for Node/Express app for testing
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
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