Refactor utils and organize routes/schema

This commit is contained in:
Johnathon Slightham
2021-05-19 20:08:04 -04:00
parent ac404a0ac5
commit cafb324ddb
15 changed files with 128 additions and 115 deletions

31
schema/post.model.js Normal file
View File

@@ -0,0 +1,31 @@
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
// Database schema for an email message
let Post = new Schema({
title: {
type: String
},
description: {
type: String
},
author: {
type: String
},
category: {
type: Array
},
link: {
type: String
},
date: {
type: Date
},
photo: {
type: String
}
}, {
collection: 'posts'
});
module.exports = mongoose.model('Post', Post);