mercredi 15 mai 2019

How do I set up my rails application to be able to receive an HTTP GET request with the requested word as the path and return the results as JSON

How to set up my rails application to be able to receive an HTTP GET request with the requested word as the path and return the results as JSON. codes as follow;

GET --> http:://{url}?search={username}

I need to return

GET /crepitus 
{"crepitus":["cuprites","pictures","piecrust"]} 
GET /crepitus,paste,kinship,enlist,boaster,fresher,sinks,knits,sort 
{"crepitus":["cuprites","pictures","piecrust"],"paste":["pates","peats","septa","spate","tapes","tepas "],"kinship":["pinkish"],"enlist":["elints","inlets","listen","silent","tinsel"],"boaster":["boaters","borate s","rebatos","sorbate"],"fresher":["refresh"],"sinks":["skins"],"knits":["skint","stink","tinks"],"sort":["o rts","rots","stor","tors"]}\ GET /sdfwehrtgegfg 
{"sdfwehrtgegfg":[]} 


and the application should be able to respond to a request made every second, should I set in on the Heroku side?

Aucun commentaire:

Enregistrer un commentaire