Authentication and authorization

This commit is contained in:
Andrew Trieu
2023-07-07 19:33:54 +03:00
committed by Andrew Trieu
parent 8dd54efa6d
commit ab526cca2a
5 changed files with 159 additions and 0 deletions

View File

@@ -8,6 +8,9 @@ import helmet from "helmet";
import morgan from "morgan";
import path from "path";
import { fileURLToPath } from "url";
import authRoutes from "./routes/auth.js";
/* Controllers */
import { register } from "./controllers/auth.js";
/**
* Config
@@ -38,6 +41,11 @@ const storage = multer.diskStorage({
});
const upload = multer({ storage });
/**
* Routes
* */
app.post("/auth/register", upload.single("profilePicture"), register);
/**
* Database
* */