refactor: init rocket project

This commit is contained in:
catvayor 2024-05-15 17:36:44 +02:00
parent be899ba87d
commit 9f8baf880a
5 changed files with 1574 additions and 0 deletions

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])
}