36 lines
516 B
Plaintext
36 lines
516 B
Plaintext
syntax = "v1"
|
|
|
|
info (
|
|
title: "5feet11"
|
|
author: "niku"
|
|
email: "nvdpoel01@gmail.com"
|
|
)
|
|
|
|
type (
|
|
ExpandReq {
|
|
ID string `path:"id"`
|
|
}
|
|
|
|
ExpandResp {
|
|
LongUrl string `json:"longUrl"`
|
|
}
|
|
)
|
|
|
|
type (
|
|
ShortenReq {
|
|
LongUrl string `json:"longUrl"`
|
|
ExpiresAfter int64 `json:"expiresAfter,optional"`
|
|
}
|
|
|
|
ShortenResp {
|
|
ID string `json:"id"`
|
|
}
|
|
)
|
|
|
|
service fivefeeteleven-api {
|
|
@handler ExpandUrl
|
|
get /:id(ExpandReq) returns(ExpandResp)
|
|
|
|
@handler ShortenUrl
|
|
post /redirect(ShortenReq) returns(ShortenResp)
|
|
} |