ah
2
.gitignore
vendored
@ -1,3 +1,3 @@
|
|||||||
.env
|
.env
|
||||||
node_modules/
|
node_modules/
|
||||||
|
uploads/
|
||||||
|
@ -8,7 +8,9 @@ const passport = require('passport');
|
|||||||
router.post('/register', async (req, res) => {
|
router.post('/register', async (req, res) => {
|
||||||
const { username, password } = req.body;
|
const { username, password } = req.body;
|
||||||
if (!username || !password) return res.status(400).json({ error: 'Missing fields' });
|
if (!username || !password) return res.status(400).json({ error: 'Missing fields' });
|
||||||
const user = new User({ username, password });
|
const pfp = "https://source.boringavatars.com/marble/" + username
|
||||||
|
console.log(pfp)
|
||||||
|
const user = new User({ username, password, profilePhoto: pfp });
|
||||||
await user.save();
|
await user.save();
|
||||||
res.sendStatus(201);
|
res.sendStatus(201);
|
||||||
console.log("register success")
|
console.log("register success")
|
||||||
|
Before Width: | Height: | Size: 14 MiB |
Before Width: | Height: | Size: 6.1 MiB |
Before Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 6.1 MiB |
Before Width: | Height: | Size: 14 MiB |
Before Width: | Height: | Size: 14 MiB |
Before Width: | Height: | Size: 6.1 MiB |
Before Width: | Height: | Size: 14 MiB |
Before Width: | Height: | Size: 14 MiB |
Before Width: | Height: | Size: 3.4 MiB |
Before Width: | Height: | Size: 6.1 MiB |
Before Width: | Height: | Size: 4.2 MiB |
Before Width: | Height: | Size: 3.4 MiB |
Before Width: | Height: | Size: 14 MiB |
Before Width: | Height: | Size: 14 MiB |
Before Width: | Height: | Size: 14 MiB |
Before Width: | Height: | Size: 4.6 MiB |