https://github.com/victorighalo/adonisjs-deliveryapi
An API that emulates Google Locations and Distance Matrix API for calculating delivery cost for LGAs in Lagos Nigeria
https://github.com/victorighalo/adonisjs-deliveryapi
adonis api nodejs
Last synced: 3 months ago
JSON representation
An API that emulates Google Locations and Distance Matrix API for calculating delivery cost for LGAs in Lagos Nigeria
- Host: GitHub
- URL: https://github.com/victorighalo/adonisjs-deliveryapi
- Owner: victorighalo
- Created: 2019-03-01T10:39:15.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-03-01T11:53:16.000Z (over 7 years ago)
- Last Synced: 2025-03-05T18:25:23.235Z (over 1 year ago)
- Topics: adonis, api, nodejs
- Language: JavaScript
- Homepage:
- Size: 143 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# An API that emulates Google Locations and Distance Matrix API for courier calculating delivery cost
## Instalation
1. Clone repo
2. Install - `npm install`.
3. Create env file with this -> [link to Gist!]( https://gist.github.com/victorighalo/8d552e3695f7ea394bc1082295f93dd8)
4. Run Mmigration
```bash
adonis migration run
```
4. Run Seeder
```js
adonis make:seed User;
```
## Authenticate
1. Login
Route - [GET] - /login
Request
`` email: 'admin@app.com', password: '123456' ``
2. Copy token to use for subsequent requests
## Get Locations
Route - [GET] - /locations
Response
```js
"data": [
{"name":"Ajeromi-Ifelodun","id":1, "zone": 3},
...
]
```
## Calculate Delivery cost
Route - [POST] - /costmatrix
1. Request
```js
from: 5,
to: 12,
weight: 9
```
2. Response
```js
{
"price": 3800,
"message": "Success"
}
```
## Run Server
```js
adonis serve --dev or adonis serve
```