https://github.com/d0x2f/birthday-checker-app
https://github.com/d0x2f/birthday-checker-app
Last synced: over 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/d0x2f/birthday-checker-app
- Owner: d0x2f
- Created: 2023-01-21T10:32:01.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-02-26T20:56:06.000Z (over 3 years ago)
- Last Synced: 2025-02-28T18:59:38.456Z (over 1 year ago)
- Language: Rust
- Size: 45.9 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Birthday Checker
Stores names with birthdays and provides a route to find the number of days
until a users next birthday.
~It's currently hosted at https://birthday-checker-3vshm7xaxa-nw.a.run.app.~
## Usage
To submit a name and a birthday, perform a `put` request like so:
```
PUT /hello/dylan
Content-Type: application/json
{
"dateOfBirth": "1990-01-12"
}
204 No Content
```
To check a users birthday, use a `get` request:
```
GET /hello/dylan
200 OK
content-type: application/json
{
"message": "Hello, dylan! Your birthday is in 355 day(s)"
}
```
## Running
Assuming your environment is authenticated to access the target google cloud platform.
Using cargo:
```bash
$ env FIRESTORE_PROJECT= cargo run
```
Using docker (assuming google auth envvar is set):
```bash
$ docker build . -t birthday-checker:latest
$ docker run \
-e GOOGLE_APPLICATION_CREDENTIALS=/creds.json \
-e FIRESTORE_PROJECT= \
-v "$GOOGLE_APPLICATION_CREDENTIALS:/creds.json" \
birthday-checker:latest
```
## Assumptions
- Name is case sensitive, i.e. `dylan` is different from `Dylan` and `dYlAN`.
- Timezones are ignored