Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
207 changes: 182 additions & 25 deletions backend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions backend/prisma.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,11 @@
// npm install --save-dev prisma dotenv
import 'dotenv/config';
import { defineConfig } from 'prisma/config';
import { PrismaPg } from '@prisma/adapter-pg';
import pg from 'pg';

const connectionString =
process.env.DATABASE_URL ||
'postgresql://postgres:postgres@localhost:5432/web3-student-lab?schema=public';

const pool = new pg.Pool({ connectionString });
const adapter = new PrismaPg(pool);

export default defineConfig({
schema: 'prisma/schema.prisma',
datasource: {
Expand Down
3 changes: 2 additions & 1 deletion backend/prisma/seed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ async function main() {
create: {
id: 'course-2',
title: 'Stellar Blockchain Fundamentals',
description: 'Understand how the Stellar blockchain works, including assets, accounts, and trustlines.',
description:
'Understand how the Stellar blockchain works, including assets, accounts, and trustlines.',
instructor: 'Web3 Academy',
credits: 2,
},
Expand Down
4 changes: 2 additions & 2 deletions backend/src/auth/auth.middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ declare global {
export const authenticate = async (
req: Request,
res: Response,
next: NextFunction,
next: NextFunction
): Promise<void> => {
try {
const authHeader = req.headers.authorization;
Expand Down Expand Up @@ -70,7 +70,7 @@ export const authenticate = async (
export const optionalAuth = async (
req: Request,
res: Response,
next: NextFunction,
next: NextFunction
): Promise<void> => {
try {
const authHeader = req.headers.authorization;
Expand Down
2 changes: 1 addition & 1 deletion backend/src/auth/auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const hashPassword = async (password: string): Promise<string> => {
*/
export const comparePassword = async (
password: string,
hashedPassword: string,
hashedPassword: string
): Promise<boolean> => {
return bcrypt.compare(password, hashedPassword);
};
Expand Down
Loading
Loading