You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
414 B

const express = require('express');
const mongoose = require('mongoose');
const app = express();
let PORT = 3000;
if(process.env.PORT){
PORT = process.env.PORT
}
app.get('/', (req, res)=>{
res.send('hi');
})
app.listen(PORT, ()=>{
console.log('listening');
})
mongoose.connect('mongodb+srv://teset:test@cluster0.cofxtr1.mongodb.net/?retryWrites=true&w=majority', ()=>{
console.log('connected to mongo');
})