Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/danieldiekmeier/punkrock
https://github.com/danieldiekmeier/punkrock
Last synced: about 7 hours ago
JSON representation
- Host: GitHub
- URL: https://github.com/danieldiekmeier/punkrock
- Owner: danieldiekmeier
- Created: 2018-03-01T15:58:05.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-03-01T16:07:23.000Z (over 6 years ago)
- Last Synced: 2024-10-28T22:47:55.262Z (17 days ago)
- Size: 1000 Bytes
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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)