partial.js logo
Latest version
v1.3.1 (RC2)

HttpRouteOptionsFlags


Using:


exports.install = function(framework) {
	framework.route('/contact/', json_contact, ['xhr', 'post']);
};

Properties


!flag {String}#prefix {String}+xhr {String}@role {String}debug {String}delete {String}http {String}https {String}json {String}logged {String}mmr {String}post {String}proxy {String}put {String}referer {String}sse {String}unlogged {String}upload {String}xhr {String}xss {String}
!flag;
optional
return String;

Set custom flag to route.

#prefix;
optionalhttp
return String;

Set route by the prefix (framework.onPrefix). Example: #android, #ios, etc..

+xhr;
optionalhttp
return String;

Request can be a XMLHttpRequest or classic GET request.

@role;
optional
return String;

Set roles to route.

debug;
optionalhttp
return String;

Set route for debug mode only.

delete;
optionalhttp
return String;

Request must contain: DELETE method.

http;
optionalhttpwebsocket
return String;

Request protocol must be HTTP. In the websocket framework replaces HTTP to WS.

https;
optionalhttpwebsocket
return String;

Request protocol must be HTTPS. In the websocket framework replaces HTTPS to WSS.

json;
optionalhttpwebsocket
return String;

Request must contain: POST method and content of the request must be a valid JSON format.

logged;
optionalhttp
return String;

Set route for logged users.

mmr;
optionalhttp
return String;

Set route for Multipart Mixed Replace mode.

post;
optionalhttp
return String;

Request must contain: POST method.

proxy;
optionalhttp
return String;

Set route as proxy method.

put;
optionalhttp
return String;

Request must contain: PUT method.

referer;
optionalhttp
return String;

Referer must contain host.

sse;
optionalhttp
return String;

Set route for Server Sent Events.

unlogged;
optionalhttp
return String;

Set route for unlogged users.

upload;
optionalhttp
return String;

Request must contain: POST method and multipart/form-data.

xhr;
optionalhttp
return String;

Request must be a XMLHttpRequest.

xss;
optionalhttp
return String;

Framework doesn't check request for XSS attack.