basic camp form system

This commit is contained in:
Chris Cochrun 2024-03-21 10:00:13 -05:00
parent 432436c0c1
commit dc15b66627
7 changed files with 340 additions and 80 deletions

View file

@ -1,16 +1,14 @@
mod api;
use std::collections::HashMap;
use actix_multipart::form::tempfile::TempFileConfig;
use actix_web::{middleware, App, HttpServer};
use api::camp_form::camp_form;
use api::church_form::church_form;
use api::health_form::health_form;
use api::local_trip_form::local_form;
use api::mt_form::mt_form;
use api::parent_form::parent_form;
use api::teacher_form::teacher_form;
use serde_json::{Number, Value};
#[actix_web::main]
async fn main() -> std::io::Result<()> {
@ -21,23 +19,6 @@ async fn main() -> std::io::Result<()> {
log::info!("starting HTTP server at http://localhost:4242");
// let mut fields = HashMap::new();
// fields.insert("value", Value::String("Frodo".to_string()));
// fields.insert("columnId", Value::Number(Number::from(106)));
// let mut data = HashMap::new();
// data.insert("data", vec![fields]);
// // let vec = vec![data];
// log::info!("{:?}", serde_json::to_string(&data).unwrap());
// let req = reqwest::Client::new()
// .post("https://staff.tfcconnection.org/apps/tables/api/1/tables/9/rows")
// .basic_auth("chris", Some("2VHeGxeC^Zf9KqFK^G@Pt!zu2q^6@b"))
// .json(&data)
// .send()
// .await;
// log::info!("{:?}", req.unwrap().text().await.unwrap());
HttpServer::new(|| {
App::new()
.wrap(middleware::Logger::default())
@ -48,6 +29,7 @@ async fn main() -> std::io::Result<()> {
.service(teacher_form)
.service(church_form)
.service(local_form)
.service(camp_form)
})
.bind(("127.0.0.1", 4242))?
.workers(2)