mirror of
https://github.com/traxys/Nixfiles.git
synced 2026-03-31 09:27:25 +02:00
templates: Add a template for web applications
This commit is contained in:
parent
47094c899f
commit
e380eff9b5
12 changed files with 328 additions and 0 deletions
9
templates/webapp/api/Cargo.toml
Normal file
9
templates/webapp/api/Cargo.toml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
[package]
|
||||
name = "api"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
serde = { version = "1.0.163", features = ["derive"] }
|
||||
12
templates/webapp/api/src/lib.rs
Normal file
12
templates/webapp/api/src/lib.rs
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
pub struct LoginRequest {
|
||||
pub username: String,
|
||||
pub password: String,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
pub struct LoginResponse {
|
||||
pub token: String,
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue