Server setup with mongodb.

Server handles creating and fetching products and their variations.
Models are saved to mongo using mongoose.
STILL PRETTY BARE BONES!
This commit is contained in:
2020-07-18 21:48:45 +02:00
parent 7078d994c0
commit 0dd3944fd2
10 changed files with 231 additions and 2 deletions

View File

@@ -0,0 +1,12 @@
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const Variation = new Schema({
size: String,
description: String,
stock: Number,
price: Number,
discount: Number
});
module.exports = mongoose.model("Variation", Variation);