Skip to content

Commit

Permalink
Some cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
mclean25 committed May 8, 2022
1 parent f1f2d12 commit 68b8c40
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DB_API_KEY_V3=
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
## Movies App

### Getting Started
1. `yarn install`
2. `yarn types`
3. `yarn dev`
2 changes: 1 addition & 1 deletion lib/graphql/moviesDataSource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Pool } from "undici";
import { Movie, PopularMoviesResponse } from "./sources/api";

export class MoviesApi extends HTTPDataSource {
apiKey = process.env.NEXT_PUBLIC_DB_API_KEY_V3;
apiKey = process.env.DB_API_KEY_V3;

constructor(baseUrl: string, pool: Pool) {
super(baseUrl, { pool });
Expand Down
4 changes: 0 additions & 4 deletions lib/graphql/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,11 @@ const pool = new Pool(baseUrl);
export const server = new ApolloServer({
schema,
async context(ctx: Context) {
// const accessToken = await getAccessTokenSafe(ctx.req, ctx.res);

return { ...ctx };
},
dataSources() {
return {
moviesApi: new MoviesApi(baseUrl, pool),
// modulesApi: new ModulesApi(baseUrl),
// programsApi: new ProgramsApi(baseUrl),
};
},
});
1 change: 0 additions & 1 deletion pages/api/graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ const handleGraphQL: NextApiHandler = async (req, res): Promise<void> => {
res.end();
return;
}
// res.setHeader("Authorization", `Bearer ${process.env.DB_API_KEY_V4}}`);

await startServer;
await server.createHandler({
Expand Down

1 comment on commit 68b8c40

@vercel
Copy link

@vercel vercel bot commented on 68b8c40 May 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.