Created
June 26, 2012 08:40
-
-
Save olivernn/2994436 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var app = Davis(function () { | |
this.configure(function () { | |
this.linkSelector = 'nav a' | |
this.formSelector = 'nav form' | |
}) | |
this.get('/', function (req) { | |
showHomePage() | |
}) | |
this.get('/pay-bill', function (req) { | |
showPayBillPage() | |
}) | |
this.get('/send-money', function (req) { | |
showSendMoneyPage() | |
}) | |
this.get('/contact-us', function (req) { | |
showContactPage() | |
}) | |
this.get('/about-us', function (req) { | |
showAboutPage() | |
}) | |
this.get('/blog', function (req) { | |
showBlog() | |
}) | |
this.post('/search', function (req) { | |
loadSearchResults(req.params['query']) | |
}) | |
}) |
Which route do you think should be a POST? The search could either be a POST or a GET, it really depends on your app to be honest. I think the navigation links should definitly be GET requests as they are links, but again this is depends on how your app works.
As long as the routes you define in Davis match how the server responds then you should be fine, so if without Davis those navigation links make get requests then they should be get requests in davis too.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi Oliver, don't you think I should do a POST so that the server knows how to respond?