Skip to content

Commit

Permalink
Replace todos api with simple select example
Browse files Browse the repository at this point in the history
  • Loading branch information
scotttrinh committed Jan 16, 2024
1 parent 1b36265 commit b8bb2a1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 73 deletions.
7 changes: 5 additions & 2 deletions packages/create/src/recipes/express/template/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { type AuthRequest } from "@edgedb/auth-express";

import { styles } from "./styles.js";
import { auth, requireAuth, signoutRoute, builtinUIRouter } from "./auth.js";
import { router as todosRouter } from "./todos.js";
import { PORT } from "./env.js";

const app = express();
Expand All @@ -14,7 +13,11 @@ app.use(express.urlencoded({ extended: false }));
app.use(cookieParser());
app.use(auth.createSessionMiddleware());

app.use("/api/todos", todosRouter);
router.get("/api/deep-thought", requireAuth, async (req: AuthRequest, res) => {
// See more examples of making queries here: https://github.com/edgedb/edgedb-examples/blob/main/express-auth/todos.ts
const answer = await req.session!.client.query<number>("select 42;");
res.json(answer);
});

app.use("/auth", builtinUIRouter);
app.use("/auth/signout", signoutRoute);
Expand Down
71 changes: 0 additions & 71 deletions packages/create/src/recipes/express/template/src/todos.ts

This file was deleted.

0 comments on commit b8bb2a1

Please sign in to comment.