Init commit

This commit is contained in:
2024-12-22 16:52:30 +03:30
parent 28ab698dfc
commit aeb38982ca
28 changed files with 1532 additions and 68 deletions
+6 -1
View File
@@ -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)
})