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
489 B

const express = require('express');
const app = express();
const PORT = process.env.PORT || 3000;
const mongoose = require('mongoose');
const mongoUri = process.env.MONGODB_URI || 'mongodb://localhost:27017/grocery_app_dev';
app.get('/', (req, res)=>{
res.send('this works');
})
app.listen(PORT, ()=>{
console.log('listening...');
})
mongoose.connect(mongoUri, { useNewUrlParser:true });
mongoose.connection.on('open', ()=>{
console.log('connected to mongoose!!!!!!');
})