- Notifications
You must be signed in to change notification settings - Fork11
Lighter-than-air node.js server framework
License
articulate/paperplane
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Lighter-than-air node.js server framework.
The main goal ofpaperplane is to make building anode.js server easy, without all of the configuration or imperative boilerplate required for other server frameworks. If you prefer to build apps with function composition or even a point-free style, thenpaperplane is for you.
Withpaperplane you get all of these out-of-the-box:
- pure, functional, Promise-basedrequest handlers
- support for request handlers that returnAlgebraic Data Types -new in v2.0
- support for highly scalableserverless deployment -new in v2.1
- composeable jsonbody parsing
- dead-simplerouting functions
- several commonresponse helpers
- json-formattedlogging
- easily configurableCORS support
- plug-n-playstatic file serving
Let's try a quick Hello World example server. It accepts a:name param in the url, and then includes that name in thejson response body.
const{ compose}=require('ramda')consthttp=require('http')const{ json, logger, methods, mount, routes}=require('paperplane')consthello=req=>({message:`Hello${req.params.name}!`})constapp=routes({'/hello/:name':methods({GET:compose(json,hello)})})http.createServer(mount({ app})).listen(3000,logger)
So simple and functional, with an easily readable routing table and pure functions for the route handler. If that sounds like fun to you, then read theGetting started guide or theAPI docs to learn more.
To help you learn the concepts used in paperplane, check out thedemo application.
If you have docker installed, you can run the demo locally:
- Clone this repo
- If you're using Docker Desktop for Windows:
cp docker-compose.override.windows.yml docker-compose.override.yml
docker-compose up- http://localhost:3000
About
Lighter-than-air node.js server framework
Topics
Resources
License
Security policy
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors11
Uh oh!
There was an error while loading.Please reload this page.
