1.2.59 • Published 3 years ago

velocitous v1.2.59

Weekly downloads
71
License
ISC
Repository
-
Last release
3 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

3 years ago

1.2.44

3 years ago

1.2.56

3 years ago

1.2.57

3 years ago

1.2.54

3 years ago

1.2.55

3 years ago

1.2.58

3 years ago

1.2.42

3 years ago

1.2.43

3 years ago

1.1.41

3 years ago

1.1.40

3 years ago

1.1.42

3 years ago

1.1.315

3 years ago

1.1.314

3 years ago

1.1.313

3 years ago

1.1.312

3 years ago

1.1.29

3 years ago

1.1.39

3 years ago

1.1.27

3 years ago

1.1.26

3 years ago

1.1.311

3 years ago

1.1.310

3 years ago

1.1.16

3 years ago

1.1.15

3 years ago

1.1.14

3 years ago

1.1.13

3 years ago

1.0.2

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.13

3 years ago

1.0.12

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago