Skip to content

Latest commit

 

History

History
40 lines (36 loc) · 1.43 KB

File metadata and controls

40 lines (36 loc) · 1.43 KB

17.08.2024

  • Fixed @File and @Folder crashes on Linux
  • Minor fixes

16.08.2024 Introducing Files and Folder Views!
(+ c3-api is officially a library now!)

Now to add c3-api to your project you should do this:

  • 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

Added Files and Folder Views

  • 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

c3-api-example/src/examples/folder.c3

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