Skip to content

Instantly share code, notes, and snippets.

@bpruitt-goddard
Created April 29, 2019 18:16
Show Gist options
  • Save bpruitt-goddard/e5b0b2c22025678561ee230c3f431e18 to your computer and use it in GitHub Desktop.
Save bpruitt-goddard/e5b0b2c22025678561ee230c3f431e18 to your computer and use it in GitHub Desktop.
Mock Iris For LD File Import
const http = require('http');
const hostname = '127.0.0.1';
const port = 54499;
const server = http.createServer((req, res) => {
// GET is for retrieving file index
if (req.method === 'GET')
{
res.statusCode = 404;
}
// Otherwise it is index request
else
{
res.statusCode = 200;
}
res.setHeader('Content-Type', 'application/json');
res.end('{}');
});
server.listen(port, hostname, () => {
console.log(`Server running at http://${hostname}:${port}/`);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment