Changed one Route (have to add cors header to all routes)
This commit is contained in:
@@ -2,10 +2,12 @@ mod users;
|
||||
mod cases;
|
||||
mod items;
|
||||
mod types;
|
||||
mod utils;
|
||||
|
||||
use users::*;
|
||||
use cases::*;
|
||||
use items::*;
|
||||
use utils::*;
|
||||
|
||||
use actix_web::web::Data;
|
||||
use actix_web::{App, HttpServer};
|
||||
@@ -17,6 +19,7 @@ struct AppState {
|
||||
token_expiration: u64,
|
||||
}
|
||||
|
||||
|
||||
#[actix_web::main]
|
||||
async fn main() -> std::io::Result<()> {
|
||||
let pool = SqlitePool::connect("sqlite:database.db")
|
||||
@@ -37,6 +40,7 @@ async fn main() -> std::io::Result<()> {
|
||||
.service(get_items)
|
||||
.service(get_case_items)
|
||||
.service(get_item_cases)
|
||||
.service(options)
|
||||
.app_data(app_state.clone())
|
||||
})
|
||||
.bind(("127.0.0.1", 8000))?
|
||||
|
||||
Reference in New Issue
Block a user