aboutsummaryrefslogtreecommitdiff
path: root/files/es/learn
diff options
context:
space:
mode:
Diffstat (limited to 'files/es/learn')
-rw-r--r--files/es/learn/server-side/node_server_without_framework/index.html8
1 files changed, 4 insertions, 4 deletions
diff --git a/files/es/learn/server-side/node_server_without_framework/index.html b/files/es/learn/server-side/node_server_without_framework/index.html
index c103f58774..8256ad5823 100644
--- a/files/es/learn/server-side/node_server_without_framework/index.html
+++ b/files/es/learn/server-side/node_server_without_framework/index.html
@@ -34,27 +34,28 @@ http.createServer(function (request, response) {
var extname = String(path.extname(filePath)).toLowerCase();
var mimeTypes = {
-  '.html': 'text/html',
+ '.html': 'text/html',
'.js': 'text/javascript',
'.css': 'text/css',
'.json': 'application/json',
'.png': 'image/png',
'.jpg': 'image/jpg',
'.gif': 'image/gif',
+ '.svg': 'image/svg+xml',
'.wav': 'audio/wav',
'.mp4': 'video/mp4',
'.woff': 'application/font-woff',
'.ttf': 'application/font-ttf',
'.eot': 'application/vnd.ms-fontobject',
'.otf': 'application/font-otf',
- '.svg': 'application/image/svg+xml'
+ '.wasm': 'application/wasm'
};
var contentType = mimeTypes[extname] || 'application/octet-stream';
fs.readFile(filePath, function(error, content) {
if (error) {
- if(error.code == 'ENOENT'){
+ if(error.code == 'ENOENT') {
fs.readFile('./404.html', function(error, content) {
response.writeHead(404, { 'Content-Type': 'text/html' });
response.end(content, 'utf-8');
@@ -63,7 +64,6 @@ http.createServer(function (request, response) {
else {
response.writeHead(500);
response.end('Sorry, check with the site admin for error: '+error.code+' ..\n');
- response.end();
}
}
else {