Prerequisites: Node.js (>=16.0.0)
You can install and configure the api using this command:
npm ci
To run the api just do the following command
npm start
The above command will bootstrap the data automatically and start a fastify server. Now you can hit the following endpoints and search for any post you like!
Few examples
curl --request GET \
--url 'http://localhost:3000/searchPost?query=%22the%20king%22'
curl --request GET \
--url 'http://localhost:3000/searchPost?query=%22the%20king%22&page=1'
curl --request GET \
--url 'http://localhost:3000/searchPost?query=the%20king'
curl --request GET \
--url 'http://localhost:3000/searchPost?query=the%20king&sortKey=dateLastEdited'
curl --request GET \
--url 'http://localhost:3000/searchPost?query=the%20king&sortKey=random'
curl --request GET \
--url 'http://localhost:3000/searchPost?query=the%20king&pageSize=115'
Just run the following
npm test