Changed shortener endpoint to /api/v1/links
This commit is contained in:
parent
4539c926ec
commit
9aee40d3b1
@ -32,5 +32,5 @@ service fivefeeteleven-api {
|
||||
get /:id(ExpandReq) returns(ExpandResp)
|
||||
|
||||
@handler ShortenUrl
|
||||
post /redirect(ShortenReq) returns(ShortenResp)
|
||||
post /api/v1/links(ShortenReq) returns(ShortenResp)
|
||||
}
|
@ -7,8 +7,8 @@ A URL shortener that generates links even shorter than 5'11.
|
||||
# Shorten a URL
|
||||
curl --header "Content-Type: application/json" \
|
||||
--request POST \
|
||||
--data '{"redirectUrl":"https://news.ycombinator.com"}' \
|
||||
http://localhost:5111/redirect
|
||||
--data '{"longUrl":"https://news.ycombinator.com"}' \
|
||||
http://localhost:5111/api/v1/links
|
||||
|
||||
# Expand the URL
|
||||
curl -iL http://localhost:5111/{id}
|
||||
|
@ -19,7 +19,7 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
|
||||
},
|
||||
{
|
||||
Method: http.MethodPost,
|
||||
Path: "/redirect",
|
||||
Path: "/api/v1/links",
|
||||
Handler: ShortenUrlHandler(serverCtx),
|
||||
},
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user