Added posts and categories

This commit is contained in:
Johnathon Slightham
2021-05-17 23:54:14 -04:00
parent 3e681bcf9b
commit fb799fa001
9 changed files with 354 additions and 2 deletions

31
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);