Skip to content
Browse files

Update example app again

  • Loading branch information...
1 parent 12ff9d9 commit 1271b0f54be1c4fc9903d6b263a7cb9d0e6b5cb4 @grncdr grncdr committed Apr 6, 2012
Showing with 6 additions and 5 deletions.
  1. +6 −5 examples/languages.coffee
View
11 examples/languages.coffee
@@ -7,7 +7,12 @@ lazorse ->
description: "Per-language greetings"
shortName: 'localGreeting'
GET: -> @ok greeting: greetingLookup[@language], language: @language
- POST: -> greetingLookup[@language] = @req.body; @ok()
+ POST: ->
+ if @req.body?.greeting
+ greetingLookup[@language] = @req.body.greeting
+ @ok('ok')
+ else
+ @error 'InvalidParameter', 'greeting', @req.body?.greeting
examples: [
{method: 'GET', vars: {language: 'english'}}
{method: 'POST', vars: {language: 'english'}, body: "howdy"}
@@ -52,8 +57,4 @@ lazorse ->
Tip! me over and pour me out!
"""
-<<<<<<< HEAD
- @resource '/teapot': GET: -> @error 'TeapotError'
-=======
@resource '/teapot': GET: -> @error new TeapotError
->>>>>>> b3a39c4... Update example app

0 comments on commit 1271b0f

Please sign in to comment.
Something went wrong with that request. Please try again.