Linux websever 5.15.0-153-generic #163-Ubuntu SMP Thu Aug 7 16:37:18 UTC 2025 x86_64
Apache/2.4.52 (Ubuntu)
: 192.168.3.70 | : 192.168.1.99
Cant Read [ /etc/named.conf ]
8.1.2-1ubuntu2.23
urlab
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
var /
www /
html /
greenpreneurs /
api /
[ HOME SHELL ]
Name
Size
Permission
Action
auth
[ DIR ]
drwxr-xr-x
config
[ DIR ]
drwxr-xr-x
controllers
[ DIR ]
drwxr-xr-x
middleware
[ DIR ]
drwxr-xr-x
routes
[ DIR ]
drwxr-xr-x
utils
[ DIR ]
drwxr-xr-x
index.js
4.6
KB
-rw-r--r--
nohup.out
13.19
KB
-rw-------
Delete
Unzip
Zip
${this.title}
Close
Code Editor : index.js
import express from 'express'; import pool from './config/db.js'; import userRoute from './routes/user.route.js'; import authRoute from "./routes/auth.route.js"; import blogRoute from "./routes/blog.route.js"; import cors from 'cors'; import session from 'express-session'; import passport from "passport"; import userDashboardRoute from "./routes/user.dashboard.route.js"; import FormData from "form-data"; import dotenv from 'dotenv'; import bodyParser from "body-parser"; import eventRoute from "./routes/event.route.js"; import individualBlogRoute from "./routes/individualBlog.route.js"; import adminDashboardRoute from "./routes/admin.dashboard.route.js"; import homeRoute from "./routes/homePage.route.js"; import nodemailer from "nodemailer"; dotenv.config(); const app = express(); const port = 4000; // app.use(bodyParser.json()); app.use(bodyParser.json({ limit: '10mb' })); // Set the limit to a higher value, e.g., 10mb app.use(bodyParser.urlencoded({ limit: '10mb', extended: true })); // Apply CORS middleware app.use(cors({ origin: '*', // Allows all origins })); app.get('/', (req, res) => { res.json({ message: 'API is up and running!' }); }); // Middleware to parse JSON bodies app.use(express.json()); // Apply express-session before passport.session() app.use(session({ secret: process.env.SESSION_SECRET || 'default_secret', resave: false, saveUninitialized: false, // Change to false, so only sessions that are modified are saved cookie: { secure: false } // Set to true if using HTTPS })); app.use(passport.initialize()); app.use(passport.session()); // Routes app.use('/api/user', userRoute); app.use('/api/auth', authRoute); app.use('/api/blogs', blogRoute); app.use('/api/user/dashboard',userDashboardRoute); app.use('/api/event',eventRoute); app.use('/api/individualBlog',individualBlogRoute); app.use('/api/admin/dashboard', adminDashboardRoute); app.use('/api/homepage', homeRoute); // app.use('/api/registerEnt', userRoute); app.post('/send-email', async (req, res) => { try { const { firstName, lastName, email, phone, message } = req.body.formData; if (!firstName || !lastName || !email || !phone || !message) { return res.status(400).json({ error: "All fields are required" }); } console.log(`Form data received: ${firstName}, ${lastName}, ${email}, ${phone}`); const transporter = nodemailer.createTransport({ service: 'Gmail', auth: { user: process.env.EMAIL_USER, pass: process.env.EMAIL_PASS, }, }); const mailOptions = { from: email, to: 'websitece81@gmail.com', subject: `Contact Form Climate Website Submission from ${firstName} ${lastName}`, text: `Name: ${firstName} ${lastName}\nEmail: ${email}\nPhone: ${phone}\nMessage: ${message}`, }; await transporter.sendMail(mailOptions); console.log("Email sent successfully"); res.status(200).json({ message: "Email sent successfully" }); } catch (error) { console.error("Error sending email:", error); if (error.response) { // Handle specific errors from the email service provider console.error("Error response from email provider:", error.response); return res.status(502).json({ error: "Failed to send email. Email provider error." }); } if (error.code === 'EAUTH') { return res.status(401).json({ error: "Invalid email credentials. Check email and password." }); } if (error.code === 'ENOTFOUND' || error.code === 'ECONNREFUSED') { return res.status(503).json({ error: "Unable to connect to the email server. Please try again later." }); } // General error fallback res.status(500).json({ error: "An unexpected error occurred. Please try again later." }); } }); // Static file serving app.use(express.static('public')); // const JWT_SECRET = process.env.JWT_SECRET; const host = process.env.HOST || '192.168.3.70'; app.listen(port, host, () => { console.log(`Listening on http://${host}:${port}`); }); // MySQL connection (async () => { try { const connection = await pool.getConnection(); // Get a connection from the pool console.log('Connected to the MySQL database'); connection.release(); // Release the connection back to the pool } catch (err) { console.error('Error connecting to the database:', err); } })();
Close