12345678910111213141516171819202122232425 |
- const express = require('express')
- const mongoose = require('mongoose')
- const User = require('./models/User')
- const app = express()
- const config = require('config')
- app.use(express.json({extended:true}))
- app.use('/api/authorization', require('./router/router'))
- const PORT = 4000
- async function start() {
- try {
- await mongoose.connect(
- 'mongodb+srv://king:LjeEojWE550bhRFv@cluster0.44osb.mongodb.net/SBox',
- {
- useNewUrlParser: true,
- useUnifiedTopology: true,
- useCreateIndex: true
- }
- )
- app.listen(PORT, () => {console.log('Server has been started...',PORT)})
- }catch (e) {
- console.log('error:',e)
- }
- }
-
- start()
|