File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import { insertRedirect } from "./functions/redirects";
11
11
import { redirectsRoutes } from "./routes/redirects" ;
12
12
import bearer from "@elysiajs/bearer" ;
13
13
import { demoRoutes } from "./routes/demo" ;
14
+ import { NOT_FOUND_PAGE , PERSONAL_WEBSITE } from "./utils/constants" ;
14
15
15
16
const app = new Elysia ( )
16
17
. use ( cors ( ) )
@@ -48,15 +49,15 @@ const app = new Elysia()
48
49
// Health check
49
50
. get ( "/ping" , ( ) => "pong" )
50
51
// Homepage redirects to personal website
51
- . get ( "/" , ( { set } ) => ( set . redirect = "https://axeelz.com" ) )
52
+ . get ( "/" , ( { set } ) => ( set . redirect = PERSONAL_WEBSITE ) )
52
53
// Link redirection, where all the magic happens
53
54
. get (
54
55
"/:code" ,
55
56
async ( { params, set } ) => {
56
57
const link = await getLink ( params . code ) ;
57
58
58
59
if ( ! link ) {
59
- set . redirect = `http://dash.axlz.me/no-link ?code=${ params . code } ` ;
60
+ set . redirect = `${ NOT_FOUND_PAGE } ?code=${ params . code } ` ;
60
61
} else {
61
62
set . status = 301 ;
62
63
set . redirect = link . url ;
Original file line number Diff line number Diff line change
1
+ export const NOT_FOUND_PAGE = "https://dash.axlz.me/no-link" ;
2
+
3
+ export const PERSONAL_WEBSITE = "https://axeelz.com" ;
You can’t perform that action at this time.
0 commit comments