-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from arnavrneo/nextjs-shift
Frontend + Go backend
- Loading branch information
Showing
35 changed files
with
658 additions
and
350 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,5 @@ | |
*.env | ||
*.air.toml | ||
*tmp | ||
frontend/.next | ||
frontend/node_modules | ||
*.next | ||
*node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { NextResponse } from 'next/server' | ||
|
||
// TODO: implement this if everything else works out | ||
// This function can be marked `async` if using `await` inside | ||
export async function middleware(request) { | ||
|
||
try { | ||
const response = await fetch(process.env.NEXT_PUBLIC_ENDPOINT + "/auth", { | ||
method: "POST", | ||
credentials: "include" | ||
}) | ||
|
||
console.log(response) | ||
if (response.ok) { | ||
return NextResponse.redirect(request.url) | ||
} else { | ||
return NextResponse.redirect(new URL('/notfound', request.url)) | ||
} | ||
} catch (error) { | ||
return NextResponse.redirect(new URL('/notfound', request.url)) | ||
} | ||
|
||
// return NextResponse.redirect(new URL('/home', request.url)) | ||
} | ||
|
||
// See "Matching Paths" below to learn more | ||
export const config = { | ||
matcher: '/awdasdsad', | ||
} |
Oops, something went wrong.