Created
June 24, 2016 10:55
-
-
Save kamilziajka/901cf4f9a58a6f0f8ff202ec18b2e219 to your computer and use it in GitHub Desktop.
server-http
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
FROM node:6 | |
ADD server.js /server.js | |
CMD ["node", "/server.js"] | |
EXPOSE 8080 |
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
const {createServer} = require('http'); | |
const host = '0.0.0.0'; | |
const port = 8080; | |
const server = createServer((req, res) => { | |
res.end('hello http'); | |
}); | |
server.listen( | |
port, | |
host, | |
() => console.log('server up') | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment