profile placeholder and auth router
This commit is contained in:
@@ -3,6 +3,7 @@ import express, { Response } from 'express';
|
||||
import { articlesRouter } from './routes/articles.ts';
|
||||
import { blocksRouter } from './routes/blocks.ts';
|
||||
import { imagesRouter } from './routes/images.ts';
|
||||
import { authRouter } from './routes/auth.ts';
|
||||
|
||||
const app = express();
|
||||
app.use(express.json());
|
||||
@@ -14,6 +15,7 @@ app.get("/status", (_, res: Response) => {
|
||||
app.use("/articles", articlesRouter);
|
||||
app.use("/blocks", blocksRouter);
|
||||
app.use("/images", imagesRouter);
|
||||
app.use("/auth", authRouter);
|
||||
|
||||
|
||||
const port = process.env.PORT || 3000;
|
||||
|
||||
@@ -39,7 +39,7 @@ articlesRouter.post("/postArticle", async (req: Request, res: Response) => {
|
||||
res.json(resp);
|
||||
});
|
||||
|
||||
articlesRouter.put("/putArticle/:articleId", async (req: Request, res: Response) => {
|
||||
articlesRouter.put("/updateArticle/:articleId", async (req: Request, res: Response) => {
|
||||
const { articleId } = req.params;
|
||||
const resp = await db.update(articles)
|
||||
.set({
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import { drizzle } from 'drizzle-orm/node-postgres';
|
||||
import { eq } from 'drizzle-orm';
|
||||
import { articles } from '../db/schema.ts';
|
||||
import express, { Request, Response } from "express";
|
||||
|
||||
const db = drizzle(process.env.DATABASE_URL!);
|
||||
export const authRouter = express.Router();
|
||||
|
||||
// TODO: implement
|
||||
Reference in New Issue
Block a user