mirror of
https://github.com/Tencent/Hippy.git
synced 2026-10-28 21:48:13 +08:00
feat(hippy-debug-server): modify debug server to support multiple files (#411)
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user