-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
45 lines (40 loc) · 1.11 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
const express = require('express')
const cors = require("cors")
//const userRouter = require('./routes/user.routes')
const router = require('./routes/routes.js')
const PORT = process.env.PORT || 8888
const app = express()
app.use(
cors({
origin: "*"
})
)
app.use(express.json())
app.use('/api', router)
app.listen(PORT, () => console.log('Server has been started on port', [PORT]))
// var nodemailer = require('nodemailer');
// const transporter = nodemailer.createTransport({
// host: 'smtp.yandex.ru',
// port: 465,
// secure: true,
// auth: {
// user: 'sergeyopypeys',
// pass: 'dajjvdbxhfqklpgq'
// }
// });
// // send email
// var mailOptions = {
// from: '[email protected]',
// to: '[email protected]',
// subject: 'Sending Email using Node',
// text: 'That was easy!'
// };
// transporter.sendMail(mailOptions, function (error, info) {
// if (error) {
// console.log(error);
// res.json(error);
// } else {
// console.log('Email sent: ' + info.response);
// res.json('Email sent: ' + info.response);
// }
// });