https://github.com/rggh/api-3
html, javascript, FastAPI, REST API, Python
https://github.com/rggh/api-3
fastapi js ml oneliners python rest-api sklearn
Last synced: 6 months ago
JSON representation
html, javascript, FastAPI, REST API, Python
- Host: GitHub
- URL: https://github.com/rggh/api-3
- Owner: RGGH
- Created: 2021-12-14T12:28:10.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2023-03-26T17:10:30.000Z (almost 3 years ago)
- Last Synced: 2025-03-28T01:55:43.185Z (10 months ago)
- Topics: fastapi, js, ml, oneliners, python, rest-api, sklearn
- Language: HTML
- Homepage:
- Size: 20.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# API-3
### html, javascript, FastAPI
#remember to add code in fastapi to allow CORS
import uvicorn
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from pydantic import BaseModel
from sklearn.neural_network import MLPRegressor
import numpy as np
app = FastAPI()
output = {}
origins = [
"http://redandgreen.co.uk"
]
app.add_middleware(
CORSMiddleware,
allow_origins=origins,
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
---
https://www.stackhawk.com/blog/configuring-cors-in-fastapi/
---
Try the code here : http://redandgreen.co.uk/indexx.html
---