mirror of
https://github.com/github/codeql.git
synced 2025-12-20 10:46:30 +01:00
16 lines
399 B
JavaScript
16 lines
399 B
JavaScript
var fs = require('fs'),
|
|
http = require('http'),
|
|
url = require('url');
|
|
|
|
var server = http.createServer(function(req, res) {
|
|
let path = url.parse(req.url, true).query.path; // $ Source
|
|
doRead(Promise.resolve(path));
|
|
});
|
|
|
|
async function doRead(pathPromise) {
|
|
fs.readFileSync(await pathPromise); // $ Alert
|
|
pathPromise.then(path => fs.readFileSync(path)); // $ Alert
|
|
}
|
|
|
|
server.listen();
|