aboutsummaryrefslogtreecommitdiff
path: root/files/es/learn
diff options
context:
space:
mode:
authoryuto0214w <yuto0214w@gmail.com>2021-11-08 12:14:01 +0900
committerMasahiro FUJIMOTO <mfujimot@gmail.com>2021-11-09 23:30:51 +0900
commit217c880305105538cea04f0834eadde9cc53dbc7 (patch)
tree94c1ad7c2c07ad8f088c033a21e78b44f5ca8e9a /files/es/learn
parent7dd5e4f16734dae80756c170c2680c98f6679368 (diff)
downloadtranslated-content-217c880305105538cea04f0834eadde9cc53dbc7.tar.gz
translated-content-217c880305105538cea04f0834eadde9cc53dbc7.tar.bz2
translated-content-217c880305105538cea04f0834eadde9cc53dbc7.zip
Sync codes on node_server_without_framework
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 {