feat(hippy-debug-server): modify debug server to support multiple files (#411)

This commit is contained in:
ilikethese
2020-11-23 14:02:30 +08:00
committed by GitHub
parent 8b161a883d
commit 508ec9f2f1
2 changed files with 1 additions and 12 deletions
@@ -53,18 +53,6 @@ async function startDevServer(args) {
if (verbose) {
logger.info('Received url request', ctx.url);
}
// Response entry js file for debugging
if (ctx.path === '/index.bundle') {
if (verbose) {
logger.info('Reading entry', entry);
}
const jsContent = fs.readFileSync(entry);
ctx.res.writeHead(200, {
'Content-Type': 'application/javascript',
});
ctx.res.write(jsContent);
return ctx.res.end();
}
// Response the content of version request
if (ctx.path === '/json/version') {
@@ -21,6 +21,7 @@ const mimeTypes = {
wma: 'audio/x-ms-wma',
wmv: 'video/x-ms-wmv',
xml: 'text/xml',
bundle: 'application/javascript',
};
function parseMimeType(pathName) {