Skip to content

Releases: adamhalasz/diet

v0.16.0

04 May 22:49
Compare
Choose a tag to compare
  • Bug Fix: In error.js set signal.responded to false 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

05 Mar 22:54
Compare
Choose a tag to compare

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

03 Mar 01:19
Compare
Choose a tag to compare
  • Introducing $.download(path, filename) #67

Now you can do:

// Register a route that downloads the /image.png as logo.png
app.get('/', function($){
    $.download('./image.png', 'logo.png')
})

v0.13.0

03 Mar 00:02
Compare
Choose a tag to compare
  • 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

02 Mar 22:52
Compare
Choose a tag to compare
  • 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

15 Jul 06:54
Compare
Choose a tag to compare
+ New Utils Controller
+ Moved isset() into the Util Controller

v0.10.5

29 Apr 09:25
Compare
Choose a tag to compare
Replaced Native Object.observe with `object.observe` module to suppor…

…t observe in Node >= v6.0.0

v0.10.3

03 Mar 17:18
Compare
Choose a tag to compare
update environment details

v0.9.28

04 Jan 17:45
Compare
Choose a tag to compare

Introducing:

  • app.model()
  • app.view()
  • app.controller()

v0.9.17

21 Oct 01:07
Compare
Choose a tag to compare
- Chainable Server Instance Creation, Listening and Routing.
- Fixed bugs with `$.end`