Init commit
This commit is contained in:
@@ -12,8 +12,13 @@ module.exports = (app) => {
|
||||
}
|
||||
mongoose
|
||||
.connect(connectionString, {})
|
||||
.then(function () {
|
||||
.then(async function () {
|
||||
console.log('MongoDB Database Connected')
|
||||
const MyModel = mongoose.model('MyCollection', new mongoose.Schema({name: String}));
|
||||
|
||||
// Create a document to force MongoDB to actually create the DB and collection
|
||||
await MyModel.create({name: 'test'});
|
||||
|
||||
app.listen(port, function () {
|
||||
console.log('Server Started On Port ' + port)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user