Skip to content

Latest commit

 

History

History
33 lines (25 loc) · 854 Bytes

QuickGuide.md

File metadata and controls

33 lines (25 loc) · 854 Bytes

Aero in 30 seconds

Routing

Instead of routing /hello via code you simply create a hello directory inside pages.

Pages

A page can have a template, style sheet, a controller, a client script and a JSON file:

  • hello/hello.pug
  • hello/hello.styl
  • hello/hello.js
  • hello/hello.client.js
  • hello/hello.json

Controllers

The hello.js controller is just an object that defines get or post methods. Or whatever you need.

exports.get = (request, response) => response.end('Hello')

To feed dynamic data from a controller to a template we pass it to response.render:

response.render({
	message: 'You requested ' + request.url
})

In the hello.pug template we can now access message:

h1= message