Skip to content

Latest commit

 

History

History
30 lines (20 loc) · 794 Bytes

README.md

File metadata and controls

30 lines (20 loc) · 794 Bytes

tinyServ

A tiny NodeJS server.

This simple server is a wrapper around the http module. It makes it easier to create routes, just like express and fastify. It also tries to offer great security features while keeping the size small.

Example

import * as app from './http.js'

app.onGet('/', async (req, res) => {
	res.render('index.html', {name: 'LiveOverflow'})
})
app.onPost('/submit', async (req, res) => {
	let data = await req.getPostData()
	res.render('index.html', {name: data.name})
})

let server = await app.start()

Documentation

Documentation and more examples are available in the documentation file.

Bugs

If you encounter any issues or bugs, please open an issue, make a pull request or send an email to joel.vermeulen5@outlook.com.