Functions
http_file_route.h File Reference

Route for serving static files. More...

Functions

VTM_API struct vtm_http_routevtm_http_file_rt_new (const char *fs_root)
 

Function Documentation

VTM_API struct vtm_http_route* vtm_http_file_rt_new ( const char *  fs_root)

Creates a route for serving static files from given root directory.

For example if the root directory is set to "/srv/static/" and the route is bound at "/files/", a HTTP request to path "/files/subdir/a.txt" will serve "/srv/static/subdir/a.txt".

Parameters
fs_rootthe root directory
Returns
http route if call succeeded
NULL if an error occured