Releases: adamhalasz/diet
Releases · adamhalasz/diet
v0.16.0
- Bug Fix: In error.js set
signal.responded
tofalse
to allow custom error routes to use$.end()
- Bug Fix: In error.js check if
app.routes.error.length
is more than 0 to only iterate through custom error handlers if there are any. This allows passing the functionality to the default error handler page
Now using $.end()
should work as expected even with a html preprocessor enabled within the callback of app.error()
:
app.error(function($){
$.end()
})
v0.15.0
Introducing app.host(location)
to allow handling hostnames and
ports without creating a new server instance. It's useful when the
hostname and port is changed by a proxy server. #73
Now can you do:
app.host('yourdomain.com')
For example to make diet work on Heroku:
const server = require('diet')
const app = server()
app.get('/', function($){
$.end('Hello Heroku from Diet!')
})
app.listen(process.env.PORT || 5000)
app.host('YOUR_APP_ID.herokuapp.com')
v0.14.1
v0.13.0
- Introducing the app.resource(path) class for grouping methods - inner functionality inspired by @luisvinicius167 's diet-group-router #32
Now you can do:
app.resource('/user/:id?')
.get(function($){ $.end('GET user ' + $.params.id) })
.post(function($){ $.end('POST user ' + $.params.id) })
.put(function($){ $.end('PUT user ' + $.params.id) })
.delete(function($){ $.end('DELETE user ' + $.params.id) })
v0.12.0
- Introducing signal.setHeader(key, value) to set a response header #61
- Introducing signal.getHeader(key) to return a response header #61
- Introducing signal.getRequestHeader(key) to return a request header
#61 - Introducing signal.error(key) to return an error with a key #61
- Introducing signal.sendFile(path) to end a response with a file #69
- Introducing $.error('message') and $.error('stack') to allow better
Error Exceptions handling with app.error(callback) - Added example for signal.error
- Added example for signal.sendFile
- No more Object.observe errors. It has been replaced by the ES6 Proxy function
- Bug Fixes
v0.10.8
+ New Utils Controller + Moved isset() into the Util Controller
v0.10.5
Replaced Native Object.observe with `object.observe` module to suppor…
v0.10.3
update environment details
v0.9.28
Introducing:
- app.model()
- app.view()
- app.controller()
v0.9.17
- Chainable Server Instance Creation, Listening and Routing. - Fixed bugs with `$.end`