micro-serve

2.0.0 • Public • Published

µserve

micro-serve is simple server wrapper for whammo usage with no configuration

Command Line

If you installed with -g you've got the app in your path. Serve the current directory on 8080 with

userve -p 8080

for more information consult userve --help

Routing

var Server = require('micro-serve');

Routing with director looks like:

var app = Server({
	director : {
		'/test' : {get:function(){
            this.res.end('Got it!');
        }}
	}
});

Whereas if you want to use the express router:

var app = Server({
	express : {
		'/test' : {get:function(req, res){
			res.end('Got it!');
		}}
	}
});

then regardless of what routes you use, you'll need attach to a port. app is a whammo instance.

app.listen(8080);

If you find any rough edges, please submit a bug!

Enjoy,

-Abbey Hawk Sparrow

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 2.0.0
    0
    • latest

Version History

Package Sidebar

Install

npm i micro-serve

Weekly Downloads

0

Version

2.0.0

License

MIT

Last publish

Collaborators

  • khrome