Browse Source

fix es6 import script mimeType (2)

sunag 7 years ago
parent
commit
629173063f
1 changed files with 14 additions and 2 deletions
  1. 14 2
      utils/servers/simplehttpserver.js

+ 14 - 2
utils/servers/simplehttpserver.js

@@ -17,8 +17,20 @@ var port = 8000,
 	urlParser = require('url'),
 	urlParser = require('url'),
 	fs = require('fs'),
 	fs = require('fs'),
 	path = require('path'),
 	path = require('path'),
-	currentDir = process.cwd();
-
+	currentDir = process.cwd(),
+	mimeTypes = {
+		"html": "text/html",
+		"js": "text/javascript",
+		"css": "text/css",
+		"jpg": "text/jpeg",
+		"png": "text/png",
+		"gif": "text/gif",
+		"ogg": "text/ogg",
+		"mp3": "audio/mpeg",
+		"mp4": "text/mp4",
+		"txt": "text/plain",
+		"bin": "application/octet-stream"
+	};
 
 
 port = process.argv[2] ? parseInt(process.argv[2], 0) : port;
 port = process.argv[2] ? parseInt(process.argv[2], 0) : port;