diff --git a/5feet11.api b/5feet11.api index 8aaaf4e..fe8fb3b 100644 --- a/5feet11.api +++ b/5feet11.api @@ -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) } \ No newline at end of file diff --git a/README.md b/README.md index b93ce5a..de56084 100644 --- a/README.md +++ b/README.md @@ -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} diff --git a/internal/handler/routes.go b/internal/handler/routes.go index 014a868..33d8c13 100644 --- a/internal/handler/routes.go +++ b/internal/handler/routes.go @@ -19,7 +19,7 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { }, { Method: http.MethodPost, - Path: "/redirect", + Path: "/api/v1/links", Handler: ShortenUrlHandler(serverCtx), }, },