This is the autoroute class. It is used to easily route views, assets and your favicon. If you don't know what these are you can take look at each of the functions.
With this function you can route assets. Assets are folders containing a certain type of "assets", e.g. stylesheets, scripts, images, etc. If you want to learn more about how to use assets take a look at the assets tutorial. By default all the assets are stored in the assets folder. You can change this folder with .folder().assets(). You can also use an absolute path. When using an absolute path the default prefix, the root and assets folder, won't be used. This path is also fixed (\\ is changed to /) before being used to support all the platforms. The assets will be routed to /{FOLDER}/{FILE}, for example: "styles.css" from folder "css" will routed to "/css/styles.css". You can also override the type that will be send with the request by using the type parameter.
// with as project env "C:\\project\\example.js" and folder "C:\\project\\assets\\css\\" containing two files:
// "example1.css" and "example2.css"
cerus.autoroute().assets("css");
// -> will load and route "example1.css" to "/css/example1.css" and "example2.css" to "/css/example2.css"
With the favicon function you can easily route the favicon of your site. The favicon is the image a browser will request to use as icon for the site. There is no folder where the icon is meant to be stored, so the path that is used will start from the root if the path isn't absolute. If it is absolute it'll directly be used. Before usage the path is fixed by replacing all \\ with / to add support for all platforms.
// with as project root "C:/project/"
cerus.autoroute().favicon("favicon.png");
// -> will load and route "C:/project/favicon.png" to the "/favicon.ico" url
This function will return the folders class for this module. With it you can change the folders the views and assets should be stored in.
This function is used to easily route a view. Views are often .html files, but can be generalized as a markup file. If you want to learn more about views you can read the tutorial about it. By default views are stored in the views folder, but you can change this with the .folders().views() function or by using an absolute path. When your path isn't absolute it is prefixed by the root and the views folder. If it is absolute the specified path won't be prefixed. All paths do however get fixed, all \ are changed to a / to support all platforms. The files also get suffixed by default. The suffix can be removed or changed with the ext parameter. The view will be routed to the specified url.
// with as project env "C:\\project\\example.js"
cerus.autoroute().view("/home", "example");
// -> will load and route "C:/project/views/example.html" to "/home"