Skip to content

waldoapp/TravelBack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TravelBack

This is the backend for our application TravelSpot.

It is intended to demonstrate the different capabilities of Waldo when used with this application.

See the below list of endpoints and their purposes.

It is deployed on Heroku and can be accessed at https://travel-back.herokuapp.com/

GET /validateEmail?email=$email

This endpoint is intended to be buggy, and highlights how you can easily debug it directly from within Waldo.

It is intended to validate a given email address while registering on TravelSpot, and should return either a 200, or a 400 with the reason why the email is rejected.

However, due to some lazy coding, some input will generate a 500.

Below is a sample of queries with their responses.

GET https://travel-back.herokuapp.com/validateEmail?email=laurent@waldo.com
HTTP/1.1 200 OK

{
  "success": true
}
GET https://travel-back.herokuapp.com/validateEmail?email=laurent@icloud.com
HTTP/1.1 400 Bad Request

{
  "success": false,
  "reason": "Domain icloud is not supported"
}
GET https://travel-back.herokuapp.com/validateEmail?email=laurent
HTTP/1.1 500 Internal Server Error

TypeError: Cannot read properties of null (reading '2')
    at file:///app/index.js:22:27
    at dispatch (/app/node_modules/koa-compose/index.js:42:32)
    at /app/node_modules/koa-router/lib/router.js:425:16
    at dispatch (/app/node_modules/koa-compose/index.js:42:32)
    at /app/node_modules/koa-compose/index.js:34:12
    at dispatch (/app/node_modules/koa-router/lib/router.js:430:31)
    at dispatch (/app/node_modules/koa-compose/index.js:42:32)
    at file:///app/index.js:37:13
    at dispatch (/app/node_modules/koa-compose/index.js:42:32)
    at /app/node_modules/koa-compose/index.js:34:12

See more at https://github.com/waldoapp/TravelBack/blob/main/index.js#L22

POST /seedAccount

This endpoint enables testing API interaction in TravelSpot with a usecase well known to our customers: seeding an account for signing in.

It creates a fresh account with the optional parameters (email and password). In case those are not provided, random email and password are used (and returned!) to allow you to login in TravelSpot with your freshly created account.

This endpoint requires FIREBASE_API_KEY defined as an environment variable.

Releases

No releases published

Packages

No packages published