base editor

This commit is contained in:
2026-09-06 22:41:55 -04:00
parent 04e66527ca
commit 4cf612758c
11 changed files with 932 additions and 31 deletions
+1
View File
@@ -8,6 +8,7 @@ export async function createPost(
next: NextFunction,
) {
try {
console.log(req.body);
const body = schemas.posts.create.parse(req.body);
const post = await prisma.post.create({
+2 -2
View File
@@ -17,6 +17,8 @@ import usersRoute from "./routers/users.js";
import postsRoute from "./routers/posts.js";
const app = express();
app.use(express.urlencoded({ extended: false }));
app.use(express.json());
// passport strategy
passport.use(
@@ -54,7 +56,6 @@ passport.deserializeUser(async (id: number, done) => {
done(null, user ?? false);
});
app.use(express.urlencoded({ extended: false }));
app.use(
session({
secret: env.SESSION_SECRET,
@@ -63,7 +64,6 @@ app.use(
}),
);
app.use(passport.session());
app.use(express.json());
if (env.NODE_ENV === "production") {
app.use(
cors({