This repository contains a solution to GoEuro dev challenge (https://github.com/goeuro/dev-test/tree/new-test) implementing a REST microservice that reads a file containing a number of bus routes and accepts GET requests with parameters station ids. The microservice searches if the specific stations are part of any route and returns a JSON with the station departure and arrival ID's along with true or false, depending if the stations have been found.
The project has been implemented using Jersey RESTful framework, Grizzly HTTP server and Maven. The project Main class initiates classes that are responsible for reading the provided file and parsing its contents, line by line, into a local data structure. After that, the service is able to receive GET request in the form of http://localhost:8088/api/direct?dep_sid={}&arr_sid={} and then proceeds to search the data structure to determine if there is a bus route that contains both stations, in which case it returns true. The service is started by the bash file service.sh along with a path for a file containing bus routes, and waits for requests until it is closed by the same bash file.