- Fixed
@Fileand@Foldercrashes on Linux - Minor fixes
- Download latest c3api.c3l from Releases
- Move c3l to your projects lib/ folder
- Add c3api to your dependencies in project.json
{
...
"dependencies": ["c3api"],
...
}- Use it in your project!
- For example project using library look here
- Now you can link to file using
@File("path")and view folder contents using@Folder("path") - It also supports dynamic arguments
- For example look here
module c3apitest;
import c3api;
import std::collections::map;
fn HttpResponse c3api::ControllerParadise.src(c3api::Cref self = null, HttpRequest req, HashMap(<String,String>) args)
@Controller("/src") @Folder(".") { // Executable folder
return {.body = "200"};
}
fn HttpResponse c3api::ControllerParadise.srcfile(c3api::Cref self = null, HttpRequest req, HashMap(<String,String>) args)
@Controller("/src/{file}") @File("./{file}") { // It also can be dynamic!
return {.body = "200"};
}
P.S. Function body with this annotations will NOT execute