Skip to content

Commit

Permalink
fix(Middleware): Changed some more stuff to hopefully fix it
Browse files Browse the repository at this point in the history
  • Loading branch information
andy1uu committed May 6, 2024
1 parent 4e1c516 commit 10b8e24
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
MONGODB_URI="mongodb+srv://andyluu:EqxSo4En8vBqPbbe@andyluu.uzkteb7.mongodb.net/?retryWrites=true&w=majority&appName=andyluu"
MONGODB_URI="mongodb+srv://andyluu:RhTdUUNFlwrJdAGY@andyluu.uzkteb7.mongodb.net/?retryWrites=true&w=majority&appName=andyluu"
NODE_ENV=development
PORT=3000
DATABASE_NAME=andyluu
Expand Down
4 changes: 3 additions & 1 deletion src/app/api/education/route.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { limiter } from "../config/limiter";
import clientPromise from "../../../../lib/mongodb";
import { NextRequest, NextResponse } from "next/server";
import { NextResponse } from "next/server";
import type { NextRequest } from "next/server";

export const GET = async (request: NextRequest, response: NextResponse) => {
try {
Expand Down Expand Up @@ -29,6 +30,7 @@ export const GET = async (request: NextRequest, response: NextResponse) => {

return NextResponse.json({ message: "OK", education }, { status: 200 });
} catch (error) {
console.log(error);
return NextResponse.json({ message: "Error", error }, { status: 500 });
}
};
2 changes: 1 addition & 1 deletion src/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const middleware = (request: NextRequest) => {
return new NextResponse(null, {
status: 401,
statusText: "Invalid API Key",
headers: { "Content-Type": "text/plain" },
headers: { "Content-Type": "application/json" },
});
}

Expand Down

0 comments on commit 10b8e24

Please sign in to comment.