Upload files to "/"

This commit is contained in:
2025-09-01 15:27:23 +05:30
commit ada137e1c0
4 changed files with 1251 additions and 0 deletions

2
.env Normal file
View File

@ -0,0 +1,2 @@
EMAIL_USER=shiharahimalshi@gmail.com
EMAIL_PASS=wgqb oibw bhqg elfc

1200
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

21
package.json Normal file
View File

@ -0,0 +1,21 @@
{
"name": "unity-auth-backend",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"description": "",
"dependencies": {
"bcryptjs": "^3.0.2",
"cors": "^2.8.5",
"dotenv": "^17.2.1",
"express": "^5.1.0",
"jsonwebtoken": "^9.0.2",
"mongoose": "^8.16.0",
"nodemailer": "^7.0.6"
}
}

28
server.js Normal file
View File

@ -0,0 +1,28 @@
const express = require('express');
const mongoose = require('mongoose');
const cors = require('cors');
const authRoutes = require('./routes/auth');
const app = express();
app.use(cors());
app.use(express.json());
app.use('/api/auth', authRoutes);
const gameRoutes = require('./routes/game');
app.use('/api/game', gameRoutes);
const reportsRouter = require('./routes/reports');
app.use('/api/reports', reportsRouter);
mongoose.connect('mongodb+srv://shiharahimalshi:M7078939m@cluster0.yyoapqj.mongodb.net/unityauth?retryWrites=true&w=majority&appName=Cluster0', {
useNewUrlParser: true,
useUnifiedTopology: true
})
.then(() => console.log('Connected to MongoDB Atlas'))
.catch(err => console.error('MongoDB connection error:', err));
app.listen(5000, () => console.log('Server running on port 5000'));