Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/danieldiekmeier/punkrock


https://github.com/danieldiekmeier/punkrock

Last synced: about 7 hours ago
JSON representation

Awesome Lists containing this project

README

        

# Punkrock

What if you could build a website in your parent's basement? What if you could punch your laptop and people could get HTML from your server? What if you could be young and have some fun?

```js
import punkrock from 'punkrock'

function Home (ctx) {
return punkrock.render('home', { name: ctx.query.name })
}

function ListBands (ctx, page = 1) {
const bands = await getTheBandsBackTogether()
return punkrock.render('bands', { bands })
}

const router = new punkrock.Router([{
route: '/',
get: Home,
}, {
route: '/bands', '/bands/page/:page',
get: ListBands,
post: AddBand
}, {
route: '/bands/:band',
get: ShowBand,
put: UpdateBand
}])

const app = new punkrock.Server(router)
punkrock.listen(8080)
```

## Reviews

"`punkrock.listen` is a nice pun" – [@timomeh](https://github.com/timomeh)