Skip to content
Snippets Groups Projects
Commit a3c7cfa8 authored by Ethan Robert's avatar Ethan Robert
Browse files

Modified API to get name

parent 9d517bac
No related branches found
No related tags found
No related merge requests found
File added
from fastapi import FastAPI
from os import getlogin
def getName():
login = getlogin()
name = login.split(".")[0][0].upper() + login.split(".")[0][1:] + " " + login.split(".")[1][0].upper() + login.split(".")[1][1:]
return name
app = FastAPI()
@app.get("/")
def read_root():
with open("message.txt", "r") as file:
return {"message": file.read()}
return getName() + " " + file.read()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment