// FOR RESENDING THE VERIFICATION LINK app.post('/resend_vl', async (req, res) => { let { id } = req.session, [{ username, email }] = await db.query( 'SELECT username, email FROM users WHERE id=?', [id] ), url = `http://localhost:${ process.env.PORT }/deep/most/topmost/activate/${id}`, options = { to: email, subject: 'Activate your Instagam account', html: `<span>Hello ${username}, You received this message because you created an account on Instagram.<span><br><span>Click on button below to activate your account and explore.</span><br><br><a href='${url}' style='border: 1px solid #1b9be9; font-weight: 600; color: #fff; border-radius: 3px; cursor: pointer; outline: none; background: #1b9be9; padding: 4px 15px; display: inline-block; text-decoration: none;'>Activate</a>`, } try { await mail(options) res.json({ mssg: 'Verification link sent to your email!!' }) } catch (error) { res.json({ mssg: 'Mail could not be sent!!' }) } })
process.env.PORT }/deep/most/topmost/activate/${insertId}`, options = {
const example = async () => { const port = process.env.PORT || 8080 const server = Hapi.server({ host: 'localhost', port: port }); await server.register(validateTokenPlugin); server.route({ method: 'GET', path: '/', handler: function (request, h) { return 'welcome'; } }); await server.start(); return server; }
(function CheckPortInUse() { const port: string = process.env.PORT || '1212'; detectPort(port, (err: ?Error, availablePort: number) => { if (port !== String(availablePort)) { throw new Error( chalk.whiteBright.bgRed.bold( `Port "${port}" on "localhost" is already in use. Please use another port. ex: PORT=4343 npm run dev`, ), ); } else { process.exit(0); } }); })();
new Promise((resolve, reject) => { const HOST = 'localhost' const PORT = process.env.PORT || clipped.config.port || 8080 const url = `http://${HOST}:${PORT}`
port = process.env.PORT || 3030 const server = app.listen(port);
(function CheckPortInUse() { const port: string = process.env.PORT || '1212'; detectPort(port, (err: ?Error, availablePort: number) => { if (port !== String(availablePort)) { throw new Error( chalk.whiteBright.bgRed.bold( `Port "${port}" on "localhost" is already in use. Please use another port. ex: PORT=4343 yarn dev` ) ); } else { process.exit(0); } }); })();
(function CheckPortInUse() { const port: string = process.env.PORT || '1212'; detectPort(port, (err: ?Error, availablePort: number) => { if (port !== String(availablePort)) { throw new Error( chalk.whiteBright.bgRed.bold( `Port "${port}" on "localhost" is already in use. Please use another port. ex: PORT=4343 yarn dev` ) ); } else { process.exit(0); } }); })();
(function CheckPortInUse() { const port: string = process.env.PORT || '1212'; detectPort(port, (err: ?Error, availablePort: number) => { if (port !== String(availablePort)) { throw new Error( chalk.whiteBright.bgRed.bold( `Port "${port}" on "localhost" is already in use. Please use another port. ex: PORT=4343 yarn dev` ) ); } else { process.exit(0); } }); })();