Command Line App that reads a file containing records in different formats and sorts the records. Comes with a REST API to access the same data
- Pipe Delimited
LastName | FirstName | Gender | FavoriteColor | DateOfBirth
- Comma Delimited
LastName, FirstName, Gender, FavoriteColor, DateOfBirth
- Space Delimited
LastName FirstName Gender FavoriteColor DateOfBirth
-
Post /records - Accepts a record, or a json array of records in any of the 3 above formats
#### Accepted Formats for POST Request # single json record in any of the above formats "LastName | FirstName | Gender | FavoriteColor | DateOfBirth" # json array of records [ "LastName | FirstName | Gender | FavoriteColor | DateOfBirth", "LastName | FirstName | Gender | FavoriteColor | DateOfBirth", ]
-
GET /records/gender - Returns all records in json format, sorted by gender (female before male), then last name ascending
-
GET /records/birthdate - Returns all records in json format, sorted by birth date ascending
-
GET /records/name - Returns all records in json format, sorted by name
- One assumption I made is that every record in a file will be in the same format
- There are test cases in the records folder
- json files are used for the POST request
- txt files are used as input files to the command line application
NodeJS https://nodejs.org/en/
# run REST API on localhost:3000 and begin command line app!
npm start