ahmedsaber commited on
Commit
4c5f7fc
1 Parent(s): c493025

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +12 -12
main.py CHANGED
@@ -1,9 +1,9 @@
1
  from fastapi import FastAPI, UploadFile, File,BackgroundTasks
2
  from rembg import remove
3
- from io import BytesIO
4
  from fastapi.responses import FileResponse
5
  import os
6
- from starlette.middleware.cors import CORSMiddleware
7
  # from fastapi.staticfiles import StaticFiles
8
 
9
 
@@ -12,17 +12,17 @@ app = FastAPI()
12
 
13
 
14
 
15
- origins = [
16
- "http://localhost:3000",
17
- ]
18
 
19
- app.add_middleware(
20
- CORSMiddleware,
21
- allow_origins=origins,
22
- allow_credentials=True,
23
- allow_methods=["*"],
24
- allow_headers=["*"],
25
- )
26
 
27
  # Directory to store processed images
28
  output_dir = "output"
 
1
  from fastapi import FastAPI, UploadFile, File,BackgroundTasks
2
  from rembg import remove
3
+
4
  from fastapi.responses import FileResponse
5
  import os
6
+ # from starlette.middleware.cors import CORSMiddleware
7
  # from fastapi.staticfiles import StaticFiles
8
 
9
 
 
12
 
13
 
14
 
15
+ # origins = [
16
+ # "http://localhost:3000",
17
+ # ]
18
 
19
+ # app.add_middleware(
20
+ # CORSMiddleware,
21
+ # allow_origins=origins,
22
+ # allow_credentials=True,
23
+ # allow_methods=["*"],
24
+ # allow_headers=["*"],
25
+ # )
26
 
27
  # Directory to store processed images
28
  output_dir = "output"