# Declare the route inside the action

> Put the route in the route option of NEWACTION and keep the URL, the validation and the code in one place.

Framework: total5
Product: Total.js 5 (total5@0.0.19)
Language: en
Content-SHA256: 224c93950bd1074c85e1c7f477d4a091e4a185e6f2eb3b71b467071cd1fc78a7
Snapshot: c0700e321579725c5cf4f5ace1ad7d2866d1b4f93c24a63c0b41b6b7998e976c
Sources: total5-installed@total5@0.0.19
Review: not-recorded

Instead of a separate `ROUTE()` line, an action can carry its own route in the `route` option. The action is then the single source of truth for its URL, input and behavior.

```js definitions/ping.js
NEWACTION('Ping/exec', {
	name: 'Ping',
	route: 'GET /ping/',
	action: function($) {
		$.success('pong');
	}
});
```
