Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import models
- import bcrypt
- from fastapi import FastAPI, HTTPException, Depends, Response
- from starlette.middleware import Middleware
- from starlette.middleware.cors import CORSMiddleware
- from typing import Annotated
- from sqlalchemy.orm import Session
- from pydantic import BaseModel, Field
- from database import SessionLocal, engine
- cors_middleware = [
- Middleware(
- CORSMiddleware,
- allow_origins=[
- "https://localhost:3000",
- "https://localhost:3001",
- "http://192.168.0.5:3000"
- ],
- allow_credentials=True,
- allow_methods=["*"],
- allow_headers=["*"]
- )
- ]
- app = FastAPI(middleware=cors_middleware)
- class ProjectBase(BaseModel):
- name: str
- release_date: str
- url: str
- imgur: str
- @app.get("/")
- async def root():
- return { "message": "HelloWorld"}
- @app.get("/homeText/")
- async def home_text():
- parts = [
- "Hi and Welcome to Mek's Hub! Here you can find information",
- "and a download link to all of the programs I have currently released.",
- "All programs come with a menu bar, so if you get stuck or need help",
- "click the Help button at the top of the screen for further assistance.",
- "There are also FAQ pages on each application too which can help answer",
- "most of your questions. The FAQ pages are built from the frequent most",
- "support questions that I receive, so if you don't see your question, then",
- "then feel free to send a support message. If you see your question, but",
- "the solution didn't work for you, please join our discord server and you",
- "can ask your question there as well."
- ]
- homeText = " ".join(parts)
- print(homeText)
- return { "homeText": homeText}
Advertisement
Add Comment
Please, Sign In to add comment