An API that helps users check if a webpage is up or down and prompts users with a text message if the state of saved sites changes
index
|
---- ----
| |
| |
server workers
| |
| |
handlers logs
| |
| |
|-----------|
|
|
helpers
|
|
data
|
|
config
index--initializes the server and workers.
servers---handles all user request and response.
workers-----handles all data logs and checks.
handlers---hanldles all routes on the server.
logs----handles creation of logfiles and their compression and update.
helpers---handles hashing of passwords, parsing payload to json , texting users, creating.
data----handles file creation and data extraction.
config---handles environment configuration.
const options = {
method: 'GET',
};
fetch('https://status.up.railway.app/ping', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
- phone
- password
you can only used the phone password you used in creating a user
const options = {
method: 'POST',
headers: {publickey: 'k7d5ih4q27nwicpxw3tr'},
body: '{"password":"lightighvt","phone":"8022623069"}'
};
fetch('https://status.up.railway.app/tokens', options)
.then(response => response.json())
.then(response => console.log(response)) // returns { phone, id, expires }
.catch(err => console.error(err));
- id
- phone
- password
const options = {
method: 'GET',
headers: {publickey: 'k7d5ih4q27nwicpxw3tr', id: '5fjikzbymsxi036o2ebf'}
};
fetch('https://status.up.railway.app/tokens?id=usg3t5war42alp6jck0j', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
- id
- firstName (optional)
- lastName (optional)
- password (optional)
- phone (required)
const options = {
method: 'PUT',
headers: {publickey: 'k7d5ih4q27nwicpxw3tr', id: '7afrngqinomsv37pt1g0'},
body: '{"id":id,"extend":true}'
};
fetch('https://status.up.railway.app/tokens', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
- id
- phone
const options = {
method: 'DELETE',
headers: {publickey: 'k7d5ih4q27nwicpxw3tr', id: '7afrngqinomsv37pt1g0'}
};
fetch('https://status.up.railway.app/users?id=id', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
- firstName
- lastName
- phone
- password
- tosAgreement
const options = {
method: 'POST',
headers: {publickey: 'k7d5ih4q27nwicpxw3tr', id: '7afrngqinomsv37pt1g0'},
body: '{"lastName":"onyela","firstName":"Udoka","password":"lightighvt","countrycode":"234","phone":"8022623069","tosAgreement":true}'
};
fetch('https://status.up.railway.app/users', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
- id
- phone
const options = {
method: 'GET',
headers: {publickey: 'k7d5ih4q27nwicpxw3tr', id: '7afrngqinomsv37pt1g0'}
};
fetch('https://status.up.railway.app/users', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
- id
- firstName (optional)
- lastName (optional)
- password (optional)
- phone (required)
const options = {
method: 'PUT',
headers: {publickey: 'k7d5ih4q27nwicpxw3tr', id: '7afrngqinomsv37pt1g0'},
body: '{"lastName":"onyela","firstName":"Udoka","password":"lightighvt","countrycode":"234","phone":"8022623069","tosAgreement":true}'
};
fetch('https://status.up.railway.app/users', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
- id
- phone
const options = {
method: 'DELETE',
headers: {publickey: 'k7d5ih4q27nwicpxw3tr', id: '7afrngqinomsv37pt1g0'}
};
fetch('https://status.up.railway.app/users?phone=8022623069', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));