Skip to content

pruebecitasg2/nodehttp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

134 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NODEHTTP

Lightweight express alternative with similar syntax and usage.

Download API

⚠ THIS PAGE IS UNDER MAINTENANCE, SOME DETAILS MAY BE INCOMPLETE/INACCURATE ⚠

Installation:

npm i sys-nodehttp

Usage:

var path = require('path'),
	nodehttp = require('sys-nodehttp'),
	server = new nodehttp.Server({
		port: process.env.PORT || 8080,
		address: '0.0.0.0',
	});

server.get('/api', (req, res) => {
	res.send('Hello world!');
});

server.post('/api', (req, res) => {
	// req.body is an object
	console.log('Recieved POST with body:', req.body);
});

server.use(nodehttp.static(path.join(__dirname, 'public')));

About

HTTP/S foundation for many services

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors