From 3460f9ad874495469cfa8d4aaa42b66f5e427bf2 Mon Sep 17 00:00:00 2001 From: Mateja Date: Mon, 3 May 2021 00:56:35 +0200 Subject: Use MongoDB (with Mongoose) to store posts. --- models/post.js | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 models/post.js (limited to 'models') diff --git a/models/post.js b/models/post.js new file mode 100644 index 0000000..3f341d1 --- /dev/null +++ b/models/post.js @@ -0,0 +1,10 @@ +const mongoose = require('mongoose'); + +const postSchema = new mongoose.Schema({ + title: String, + text: String +}); + +const postModel = mongoose.model('post', postSchema); + +module.exports = postModel; -- cgit v1.2.3