changed to subdomain
This commit is contained in:
+13
-4
@@ -41,10 +41,19 @@ model.load_state_dict(torch.load(full_path, map_location=torch.device(device)))
|
||||
model.to(device)
|
||||
model.eval()
|
||||
|
||||
app = FastAPI(
|
||||
root_path="/cnn-api",
|
||||
openapi_url="/cnn-api/openapi.json",
|
||||
docs_url="/cnn-api/docs"
|
||||
app = FastAPI()
|
||||
|
||||
origins = [
|
||||
"https://marvinkrausser.com",
|
||||
"https://api.marvinkrausser.com",
|
||||
]
|
||||
|
||||
app.add_middleware(
|
||||
CORSMiddleware,
|
||||
allow_origins=origins,
|
||||
allow_credentials=True,
|
||||
allow_methods=["*"],
|
||||
allow_headers=["*"],
|
||||
)
|
||||
|
||||
@app.post("/predict")
|
||||
|
||||
@@ -4,8 +4,8 @@ import './Bird_CNN.css';
|
||||
|
||||
function Bird_CNN() {
|
||||
const apiUrl = process.env.NODE_ENV === "development"
|
||||
? "https://marvinkrausser.com/cnn-api"
|
||||
: "https://marvinkrausser.com/cnn-api";
|
||||
? "https://api.marvinkrausser.com"
|
||||
: "https://api.marvinkrausser.com";
|
||||
|
||||
const [file, setFile] = useState(null);
|
||||
const [birdClass, setBirdClass] = useState(null);
|
||||
|
||||
Reference in New Issue
Block a user