Skip to content
This repository has been archived by the owner on Apr 30, 2019. It is now read-only.

Latest commit

 

History

History
30 lines (21 loc) · 784 Bytes

Parameters.md

File metadata and controls

30 lines (21 loc) · 784 Bytes

URL parameters

The parsing of URL parameters is slightly different to usual servers.

For example, let's assume you have a page called users which is available by visiting /users. The same page and its controller will be called when you request /users/MyName or even /users/MyName/profile.

In all cases you can access request.params inside the users.js controller which gives you an array of parameters:

// users
[]

// users/MyName
['MyName']

// users/MyName/profile
['MyName', 'profile']

Query parameters

If you don't like the Aero way of passing parameters to a page you can still use the traditional way and access parameters via request.query:

// users?userName=MyName&component=profile
{
	userName: 'MyName',
	component: 'profile'
}