A simple API for getting the current time. You can use this for devices that don't have a clock.
Note
You can visit the docs for the API at https://time.dodaucy.com
Warning
Please use the API behind a proxy like Nginx and set the Host
, X-Forwarded-For
and X-Forwarded-Proto
headers.
-
Clone the repository (Skip this if you have already cloned the repo)
sudo apt update sudo apt install git -y git clone https://github.com/dodaucy/time-api.git cd time-api
-
Install Docker
-
Build the Docker image
docker build -t time-api .
-
Run
Replace
YOUR_PORT
with the port you configured in the proxy.docker run -d -p 127.0.0.1:YOUR_PORT:8000 --restart always --name time-api time-api
sudo apt update
sudo apt install python3 python3-pip python3-venv git -y
git clone https://github.com/dodaucy/time-api.git # Skip this if you have already cloned the repo
cd time-api # Skip this if you have already cloned the repo
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
deactivate
source venv/bin/activate
python3 -m uvicorn main:app --reload # Running on http://127.0.0.1:8000
deactivate