/TrainTicketMachine

API for searching railway stations

Primary LanguageC#

LinkedIn

GitHub Actions Workflow Status GitHub Actions Workflow Status GitHub Actions Workflow Status

TrainTicketMachine

Description

Station to the Train Ticket Machine task

How to use

  1. Clone
  2. Run docker-compose up
  3. Send get request with "prefix" parameter eg.: localhost:80/Stations?prefix=Ad
  4. Response:
 {
  "stationsNames": [
      "Adderley Park",
      "Addiewell",
      "Addlestone",
      "Adisham",
      "Adlington (Cheshire)",
      "Adlington (Lancs)",
      "Adwick"
  ],
  "nextLetters": [
      "d",
      "i",
      "l",
      "w"
  ]
}
  1. Url with station data source is sotred in appsettings.json in section InfrastructureConfig:StationsApiUrl

Quick postman tests results

  1. localhost:80/Stations?prefix=Ad
  {
   "stationsNames": [
       "Adderley Park",
       "Addiewell",
       "Addlestone",
       "Adisham",
       "Adlington (Cheshire)",
       "Adlington (Lancs)",
       "Adwick"
   ],
   "nextLetters": [
       "d",
       "i",
       "l",
       "w"
   ]
 }
  1. localhost:80/Stations?prefix=Adderley
{
    "stationsNames": [
        "Adderley Park"
    ],
    "nextLetters": [
        " "
    ]
}
  1. localhost:80/Stations?prefix=NotAStation
{
    "stationsNames": [],
    "nextLetters": []
}