mirror of
https://github.com/Xevion/linkpulse.git
synced 2025-12-06 09:15:32 -06:00
project init
This commit is contained in:
4
README.md
Normal file
4
README.md
Normal file
@@ -0,0 +1,4 @@
|
||||
# linkpulse
|
||||
|
||||
This is an empty project right now. It merely holds a simplistic FastAPI server to showcase Railway.
|
||||
|
||||
11
main.py
Normal file
11
main.py
Normal file
@@ -0,0 +1,11 @@
|
||||
from fastapi import FastAPI, Request
|
||||
from datetime import datetime
|
||||
|
||||
app = FastAPI()
|
||||
|
||||
|
||||
@app.get("/")
|
||||
async def get_current_time(request: Request):
|
||||
current_time = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
|
||||
user_ip = request.headers.get("X-Forwarded-For")
|
||||
return {"time": current_time, "ip": user_ip}
|
||||
9
railway.json
Normal file
9
railway.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"$schema": "https://railway.app/railway.schema.json",
|
||||
"build": {
|
||||
"builder": "NIXPACKS"
|
||||
},
|
||||
"deploy": {
|
||||
"startCommand": "hypercorn main:app --bind \"[::]:$PORT\""
|
||||
}
|
||||
}
|
||||
2
requirements.txt
Normal file
2
requirements.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
fastapi==0.100.0
|
||||
hypercorn==0.14.4
|
||||
Reference in New Issue
Block a user