Skip to content
Open
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
2 changes: 1 addition & 1 deletion apps/backend/db/.env.dev
Original file line number Diff line number Diff line change
@@ -1 +1 @@
DATABASE_URL=postgresql://branch_dev:password@localhost:5433/branch_db
DATABASE_URL=postgresql://branch_dev:password@localhost:5432/branch_db
9 changes: 0 additions & 9 deletions apps/backend/lambdas/projects/handler.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { APIGatewayProxyEvent, APIGatewayProxyResult } from 'aws-lambda';

import db from './db';

export const handler = async (event: any): Promise<APIGatewayProxyResult> => {
Expand All @@ -18,14 +17,6 @@ export const handler = async (event: any): Promise<APIGatewayProxyResult> => {

// >>> ROUTES-START (do not remove this marker)
// CLI-generated routes will be inserted here

// GET /projects
if (rawPath === '/' && method === 'GET') {
const projects = await db.selectFrom("branch.projects").selectAll().execute();
return json(200, projects);
}

// <<< ROUTES-END

return json(404, { message: 'Not Found', path: normalizedPath, method });
} catch (err) {
Expand Down
7 changes: 5 additions & 2 deletions apps/backend/lambdas/projects/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,19 @@ paths:
properties:
ok:
type: boolean

/projects:
get:
summary: GET /projects
responses:
'200':
description: OK

/projects/{id}/donors:
get:
summary: GET /projects/{id}/donors
/projects/{id}:
get:
summary: GET /projects/{id}

parameters:
- in: path
name: id
Expand Down Expand Up @@ -75,3 +77,4 @@ paths:
responses:
'200':
description: OK

Loading