Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gowrizrh/mithril
https://github.com/gowrizrh/mithril
Last synced: 8 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/gowrizrh/mithril
- Owner: gowrizrh
- Created: 2020-11-05T09:48:12.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-10-22T23:42:48.000Z (3 months ago)
- Last Synced: 2024-11-13T15:20:04.766Z (2 months ago)
- Language: PHP
- Homepage:
- Size: 322 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Mithril
![Mithril](screenshot.png)
## Environment
This project is written in PHP 8.3 with the lumen microframework.## Running the project
1. Run `composer install`
2. Copy `.env.example` to `.env` and set `APP_DEBUG=false`
3. Simply open the project folder and use php's in built server to serve the public directory
4. `php -S localhost:8000 -t public`### Using Postman
There is also a postman collection file included to debug the API with Postman. Simply import it, create an environment
and then create the following variables and values.`scheme` - `http`
`host` - `localhost`
`port` - `8000`
`prefix` - `api`
### API Documentation
#### Endpoints
---
Find the number of days between two datetime parameters.```
POST api/days
```
**Parameters**`start` - An ISO 8601 date string
`end` - An ISO 8601 date string
Also see [`PHP DateTime::ATOM`](https://www.php.net/manual/en/class.datetimeinterface.php#datetime.constants.atom)
*Optional* `format` - Accepts `s` for seconds, `m` for minutes, `h` for hours and `y` for years, any other value is invalid.
---
Find the number of week days between two datetime parameters.
```
POST api/weekdays
```
**Parameters**`start` - An ISO 8601 date string
`end` - An ISO 8601 date string
Also see [`PHP DateTime::ATOM`](https://www.php.net/manual/en/class.datetimeinterface.php#datetime.constants.atom)
*Optional* `format` - Accepts `s` for seconds, `m` for minutes, `h` for hours and `y` for years, any other value is invalid.
---
Find the number of complete weeks between two datetime parameters.
```
POST api/weeks
```
**Parameters**`start` - An ISO 8601 date string
`end` - An ISO 8601 date string
Also see [`PHP DateTime::ATOM`](https://www.php.net/manual/en/class.datetimeinterface.php#datetime.constants.atom)
*Optional* `format` - Accepts `s` for seconds, `m` for minutes, `h` for hours and `y` for years, any other value is invalid.
---