shorturl.api 433 B

123456789101112131415161718192021222324252627282930313233
  1. type (
  2. expandReq struct {
  3. shorten string `form:"shorten"`
  4. }
  5. expandResp struct {
  6. url string `json:"url"`
  7. }
  8. )
  9. type (
  10. shortenReq struct {
  11. url string `form:"url"`
  12. }
  13. shortenResp struct {
  14. shorten string `json:"shorten"`
  15. }
  16. )
  17. service shorturl-api {
  18. @server(
  19. handler: ShortenHandler
  20. )
  21. get /shorten(shortenReq) returns(shortenResp)
  22. @server(
  23. handler: ExpandHandler
  24. )
  25. get /expand(expandReq) returns(expandResp)
  26. }