text: 'use strict';
  const http = require('http');
  const url = require('url');
  const path = require('path');
  const fs =require('fs');
  
  // set the mime types of the serever
  const mimeTypes = {
  
  	"html": "text/html",
  	"jpeg": "image/jpeg",
  	"jpg" : "image/jpg",
  	"png" : "image/png",
  	"js"  : "text/javascript",
  	"css" : "text/css"	
  };
  // create especifcation of server
  http.createServer(function(req, res){
  		var uri = url.parse(req.url).pathname;
  		var filename = path.join(process.cwd(), unescape(uri));
  		console.log("Carregando" + uri);
  		var stats;
  
  		try{
  			stats = fs.lstatSync(filename);
  		} catch (e){
  			res.writeHead(404,{'Content-type': 'text/plain'});
  			res.write('404 Not Found\n');
  			res.end();
  			return;
  		};
  
  		if(stats.isFile()){
  			var mimeType = mimeTypes[path.extname(filename).split(".").reverse()[0]];
  			res.writeHead(200,{'Content-type': mimeType});
  
  			var fileStream = fs.createReadStream(filename);
  			fileStream.pipe(res);				
  
  		}else if( stats.isDirectory()){
  			res.writeHead(302,{
  				'Location': 'index.html'
  			});
  			res.end();
  		}else{
  			res.writeHead(500,{'Content-type': 'tex/plain'});
  			res.write('500 internal Erro\n');
  			res.end();
  		};
  }).listen(1337);