Skip to content

A solution to GoEuro challenge implementing a REST API serving requests for searching stations in large file (Java, Jersey)

Notifications You must be signed in to change notification settings

markosfount/REST-Microservice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

REST-Microservice

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.

About

A solution to GoEuro challenge implementing a REST API serving requests for searching stations in large file (Java, Jersey)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published