rewrite backend in rust #32

Merged
lbailly merged 14 commits from rewrite into master 2024-06-13 13:20:05 +02:00
5 changed files with 1574 additions and 0 deletions
Showing only changes of commit 9f8baf880a - Show all commits

6
.gitignore vendored
View file

@ -1,3 +1,9 @@
node_modules node_modules
package-lock.json package-lock.json
config.js config.js
.envrc
.direnv
# Added by cargo
/target

1541
Cargo.lock generated Normal file

File diff suppressed because it is too large Load diff

9
Cargo.toml Normal file
View file

@ -0,0 +1,9 @@
[package]
name = "traque"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
rocket = "0.5.0"

7
shell.nix Normal file
View file

@ -0,0 +1,7 @@
{ pkgs ? (import <nixpkgs>) { }, lib ? pkgs.lib}:
let
fenix = import (fetchTarball "https://github.com/nix-community/fenix/archive/main.tar.gz") { };
in
pkgs.mkShell {
buildInputs = with fenix.latest; [ cargo rustc ];
}

11
src/main.rs Normal file
View file

@ -0,0 +1,11 @@
#[macro_use] extern crate rocket;
#[get("/")]
fn index() -> &'static str {
"Hello, world!"
}
#[launch]
fn rocket() -> _ {
rocket::build().mount("/", routes![index])
}