Skip to content

Releases: velikoss/c3-api

Release build-17

17 Aug 17:56

Choose a tag to compare

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

Release build-16

17 Aug 08:13

Choose a tag to compare

17.08.2024

  • Fixed @File and @Folder crashes 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

17 Aug 07:31
7e06be5

Choose a tag to compare

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 Aug 17:33

Choose a tag to compare

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

16 Aug 16:36
573340e

Choose a tag to compare

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
}

Old

09 Aug 18:20
f7021bc

Choose a tag to compare

Old

Release before introduction of controllers.