Skip to content

patci-zz/server-butler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

86 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Server Butler

Server Butler is a picky, opinionated web framework that only handles GET requests*

*It also handles files.

To use

Install with the command npm install server-butler
Pull into your server.js file with
var butler = require('server-butler')
require ('http')
Set a route using
butler.set(route, method, content)
Each argument should be a string.
route = the intended route, ie / or /hello/world
method = 'GET', that's the only thing that works right now!
content = either a string ie 'hello world' or a filename relative to ../public

Once your routes are established, use:

```http.createServer(function(req, res) {```
```butler.retrieve(req, res);```
`});`
and listen on your favorite port (see the example directory). Now when you open a browser and call a registered route, you'll see the specified content!

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published