https://github.com/dayvsonlima/crush.js
A MVC web application Node framework OO Based using Babel
https://github.com/dayvsonlima/crush.js
framework nodejs
Last synced: 12 months ago
JSON representation
A MVC web application Node framework OO Based using Babel
- Host: GitHub
- URL: https://github.com/dayvsonlima/crush.js
- Owner: dayvsonlima
- Created: 2018-02-17T04:38:05.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-02-25T02:04:23.000Z (about 8 years ago)
- Last Synced: 2025-02-15T19:49:36.013Z (about 1 year ago)
- Topics: framework, nodejs
- Language: JavaScript
- Homepage:
- Size: 68.4 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Crush.js
=================
A MVC web application Node framework OO Based using Babel
## Router system
```javascript
// app/routes.js
export default function Routes() {
this.root('photos#index')
this.resources('photos')
}
```
## Friendly controller syntax
```javascript
// app/controllers/photos.js
import { Controller } from 'crush'
class Photos extends Controller {
index() {
this.render('show')
}
}
export default Photos
```
## Create APIs easily
```javascript
// app/views/photos/show.js
export default jbuilder.encode((json) => {
json.set('photo', (json) => {
json.extract(photo, 'id', 'name', 'url')
})
})
// output: {"photo":{"id":1,"name":"my photo","url":"localhost:9000/photos/media/my_photo.png"}}
```