mirror of
https://github.com/arkorty/Reduce.git
synced 2026-03-18 00:47:10 +00:00
Revert "fix: remove reduce/ from request URI"
This reverts commit d8bf101527.
This commit is contained in:
@@ -147,8 +147,8 @@ func main() {
|
|||||||
return c.String(http.StatusOK, "Backend is running alright.\n")
|
return c.String(http.StatusOK, "Backend is running alright.\n")
|
||||||
})
|
})
|
||||||
|
|
||||||
e.POST("/shorten", shortenURL)
|
e.POST("/reduce/shorten", shortenURL)
|
||||||
e.GET("/:id", fetchLongURL)
|
e.GET("/reduce/:id", fetchLongURL)
|
||||||
|
|
||||||
e.Logger.Fatal(e.Start(":8080"))
|
e.Logger.Fatal(e.Start(":8080"))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ export async function GET(request, { params }) {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await axios.get(
|
const response = await axios.get(
|
||||||
`${process.env.NEXT_PUBLIC_BACKEND_URL}/${id}`
|
`${process.env.NEXT_PUBLIC_BACKEND_URL}/reduce/${id}`
|
||||||
);
|
);
|
||||||
if (response.status === 200) {
|
if (response.status === 200) {
|
||||||
return NextResponse.redirect(response.data.long_url);
|
return NextResponse.redirect(response.data.long_url);
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ export default function Home() {
|
|||||||
const baseURL = window.location.origin;
|
const baseURL = window.location.origin;
|
||||||
try {
|
try {
|
||||||
const response = await axios.post(
|
const response = await axios.post(
|
||||||
`${process.env.NEXT_PUBLIC_BACKEND_URL}/shorten`,
|
`${process.env.NEXT_PUBLIC_BACKEND_URL}/reduce/shorten`,
|
||||||
{
|
{
|
||||||
long_url: longUrl,
|
long_url: longUrl,
|
||||||
base_url: baseURL,
|
base_url: baseURL,
|
||||||
|
|||||||
Reference in New Issue
Block a user