Releases: velikoss/c3-api
Releases · velikoss/c3-api
Release build-17
17.08.2024
- Fixed
@Fileand@Foldercrashes 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
Release build-16
17.08.2024
- Fixed
@Fileand@Foldercrashes on Linux
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
Release build-15
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
Release build-12
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
Release build-11
12.08.2024 Introducing CORS!
Now server automatically serves CORS requests.
To enable that delete your old config to update it.
config.json
{
"address": "127.0.0.1",
"port": 8080,
"enable-cors": true
}