Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
devRabbani committed Aug 25, 2021
2 parents d324711 + 3fe701a commit e31c8c7
Show file tree
Hide file tree
Showing 12 changed files with 4,148 additions and 12 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules

storage/*
!storage/.gitkeep

.env
17 changes: 17 additions & 0 deletions config/db.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
require('dotenv').config()
const mongoose = require('mongoose')

function connectDB() {
mongoose.connect(process.env.MONGO_URL, {
useNewUrlParser: true,
useCreateIndex: true,
useUnifiedTopology: true,
})

const db = mongoose.connection
db.once('open', () => {
console.log('DB connected')
}).catch((error) => console.log('DB connection failed'))
}

module.exports = connectDB
12 changes: 0 additions & 12 deletions index.html

This file was deleted.

26 changes: 26 additions & 0 deletions models/file.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
const mongoose = require('mongoose')
const Schema = mongoose.Schema

const fileSchema = new Schema(
{
filename: {
type: String,
required: true,
},
path: {
type: String,
required: true,
},
size: {
type: Number,
required: true,
},
uuid: {
type: String,
required: true,
},
},
{ timestamps: true }
)

module.exports = mongoose.model('File', fileSchema)
Loading

0 comments on commit e31c8c7

Please sign in to comment.