1.2.59 • Published 4 years ago

velocitous v1.2.59

Weekly downloads
71
License
ISC
Repository
-
Last release
4 years ago

Velicitous

Velicitous is a static file server with programmable endpoints for nodejs.

Usage

Example

const velocitous = require("velocitous");
const server = velocitous.start({
	port: 80,
	rootFolder: "var/www/html",
	rewriteIndex: true,
});
server.endpoint(
	(info) => info.url.pathname === "something",
	function (req, res) {
		res.write("you've found something!");
		res.end();
	}
);

API

velocitous.start(config)

config: port- The port the server should run on. rootFolder- A relative location that contains static files to be served. rewriteIndex- Whether the server should serve index.html automatically.

velocitousServer.endpoint(checker, actor)

arguments: checker - A function which should return a truthy or falsy value depending on whether the requested resource matches some condition. actor - A function which the IncomingMessage and ServerResponse is passed to, instead of serving a static resource, if the checker returns a truthy value.

1.2.59

4 years ago

1.2.44

4 years ago

1.2.56

4 years ago

1.2.57

4 years ago

1.2.54

4 years ago

1.2.55

4 years ago

1.2.58

4 years ago

1.2.42

4 years ago

1.2.43

4 years ago

1.1.41

4 years ago

1.1.40

4 years ago

1.1.42

4 years ago

1.1.315

4 years ago

1.1.314

4 years ago

1.1.313

4 years ago

1.1.312

4 years ago

1.1.29

4 years ago

1.1.39

4 years ago

1.1.27

4 years ago

1.1.26

4 years ago

1.1.311

4 years ago

1.1.310

4 years ago

1.1.16

4 years ago

1.1.15

4 years ago

1.1.14

4 years ago

1.1.13

4 years ago

1.0.2

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago