You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
433 B
Plaintext
33 lines
433 B
Plaintext
|
|
|
|
type (
|
|
expandReq struct {
|
|
shorten string `form:"shorten"`
|
|
}
|
|
|
|
expandResp struct {
|
|
url string `json:"url"`
|
|
}
|
|
)
|
|
|
|
type (
|
|
shortenReq struct {
|
|
url string `form:"url"`
|
|
}
|
|
|
|
shortenResp struct {
|
|
shorten string `json:"shorten"`
|
|
}
|
|
)
|
|
|
|
service shorturl-api {
|
|
@server(
|
|
handler: ShortenHandler
|
|
)
|
|
get /shorten(shortenReq) returns(shortenResp)
|
|
|
|
@server(
|
|
handler: ExpandHandler
|
|
)
|
|
get /expand(expandReq) returns(expandResp)
|
|
} |