CORS allowed added
This commit is contained in:
20
src/main.rs
20
src/main.rs
@@ -1,28 +1,28 @@
|
||||
extern crate actix_web;
|
||||
extern crate diesel;
|
||||
use std::{io};
|
||||
use std::io;
|
||||
|
||||
|
||||
use actix_web::{middleware, App, HttpServer};
|
||||
use diesel::r2d2::{ConnectionManager, Pool, PooledConnection};
|
||||
use actix_cors::Cors;
|
||||
use actix_web::{App, HttpServer, middleware};
|
||||
use diesel::PgConnection;
|
||||
use diesel::r2d2::{ConnectionManager, Pool, PooledConnection};
|
||||
|
||||
mod connection;
|
||||
mod constants;
|
||||
mod loota;
|
||||
mod models;
|
||||
mod schema;
|
||||
mod connection;
|
||||
|
||||
pub type DBPool = Pool<ConnectionManager<PgConnection>>;
|
||||
pub type DBPooledConnection = PooledConnection<ConnectionManager<PgConnection>>;
|
||||
|
||||
|
||||
#[actix_rt::main]
|
||||
async fn main() -> io::Result<()> {
|
||||
env_logger::init();
|
||||
|
||||
HttpServer::new(|| {
|
||||
App::new()
|
||||
.wrap(Cors::permissive())
|
||||
.wrap(middleware::Logger::default())
|
||||
.service(loota::get)
|
||||
.service(loota::get_admin_orders)
|
||||
@@ -30,7 +30,7 @@ async fn main() -> io::Result<()> {
|
||||
.service(loota::get_admin_boxes)
|
||||
.service(loota::update)
|
||||
})
|
||||
.bind("0.0.0.0:9090")?
|
||||
.run()
|
||||
.await
|
||||
}
|
||||
.bind("0.0.0.0:9090")?
|
||||
.run()
|
||||
.await
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user