# Limit the payload size and the timeout of a route

> Append <1kb or <10s to a route to cap the request size or the time the handler may take.

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

At the end of a route you can add limits that start with `<`. `<2mb`, `<10kb` and `<500b` set the maximum size of the request body; `<30s`, `<5m` and `<1h` set the timeout of the request. A request over the limit is rejected before your handler runs.

```js controllers/limits.js
exports.install = function() {
	ROUTE('POST /small/ <1kb', small);
	ROUTE('POST /big/ <5mb', big);
};

function small($) {
	$.json({ ok: true });
}

function big($) {
	$.json({ ok: true });
}
```
