Personal blog written from scratch using Node.js, Bootstrap, and MySQL. https://jrtechs.net
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

35 lines
747 B

var http = require('http');
const url = require('url');
const fs = require('fs');
const utils = require('./utils.js');
const includes = require('./includes.js');
http.createServer(function (req, res)
{
var q = url.parse(req.url, true);
var filename = "." + q.pathname;
//prints header
includes.printHeader(res);
utils.include(res, "README.md");
if(filename.includes("/category"))
{
console.log("categories");
test();
}
else if(filename.includes("/posts/"))
{
console.log("posts");
}
else if(filename.includes("/downloads/"))
{
console.log("downloads");
}
else
{
console.log("default");
}
includes.printFooter(res);
}).listen(8080);