-
-
Save robertklep/93fb9122a20e4acacc44161fbacca496 to your computer and use it in GitHub Desktop.
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
// to test: | |
// $ echo 'GET / HTTP/1.0\n\n' | nc localhost 3012 | |
const app = require('express')(); | |
const server = app.listen(3012); | |
const delay = ms => new Promise(resolve => setTimeout(resolve, ms)); | |
app.get('/', async (req, res) => { | |
res.write("USERID,NAME,FBID,ACCOUNT,SUBSCRIPTION,PRICE,STATE,TIMEPERIOD\n"); | |
for (var i = 0; i < 10; i++) { | |
res.write("23,John Doe,1234,500,SUBSCRIPITON,100,ACTIVE,30\n"); | |
await delay(1000); | |
} | |
res.end(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Better test this server with:
curl http://localhost:3012 -N