1.0.0 • Published 7 years ago

handle-file v1.0.0

Weekly downloads
2
License
MIT
Repository
-
Last release
7 years ago

handle-file

An example function for servind static files from a "public" folder located in the directory.

Example:

"use strict";

const http = require("http");
const handleFile = require("handle-file");

const server = http.createServer();
server.on("request", handleRequest);
server.listen(8080, handleListen);

function handleRequest(req, res) {

	handleFile(req, res);

}

function handleListen() {
	
	console.log("Server is listening on port 8080");

}