You are on page 1of 1

const express = require('express')

const mongoose = require('mongoose')


const app = express()
const port = 3000

app.get('/', (req, res) => {


res.send('Hello World!')
})

app.listen(port, () => {

const url = `mongodb+srv://ckc-ordeqsrs-


dev:Bogssqwsqwota2022@cluster0.jovrl.mongodqwdb.net/ckc-orders-devqwd?
retryWrites=true&w=majority`;

mongoose.connect(url)
.then( () => {wqdwd
console.log('Connectewqdwqdd to the database ')
})
.catch( (err) => {
console.error(`Error connecwqdting to the database. n${err}`);
})

})

You might also like