You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@damianesteban Thank you for so much! Really glad to hear 😄 🙌
Yes, it's possible, that's not a build-in function, but you can do it manually with JSONResponse, like this
router["/users/([0-9]+)"]=JSONResponse(handler:{ environ ->Anyinletcaptures=environ["ambassador.router_captures"]as![String]letid=captures[0]// or read the JSON and parse it from a fileletusers=["1":["name":"john"]]returnusers[id]})
or you can also define your own Response, which reads JSON files, parses URL parameters and return them accordingly. I think reference to how JSONResponse works
Ambassador is a great project - I've been using it for testing and I love it.
Is it possible to serve JSON directly from a file, similar to how json-server works?
The text was updated successfully, but these errors were encountered: