Last active
May 9, 2020 07:51
-
-
Save WhereJuly/7b275ec75380505aa9db9a384f0e4ab3 to your computer and use it in GitHub Desktop.
Basic Express server serving a simplest app with server object exported for tests
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
'use strict'; | |
const app = require('express')(); | |
app.get('/', (req, res) => { | |
res.status(200).json({ message: 'Connected!' }); | |
}); | |
// Turn on that server! | |
const server = app.listen(3000, () => { | |
console.log('App listening on port 3000'); | |
}); | |
module.exports = server; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment