New project structure

New folder structure
Changed to type:module
Moved routes to separate files
This commit is contained in:
2020-07-17 22:07:55 +02:00
parent ad8ed283d2
commit 2abec5017f
28 changed files with 1252 additions and 305 deletions

View File

@@ -1,4 +1,4 @@
const mongoose = require("mongoose");
import mongoose from "mongoose";
const dishSchema = mongoose.Schema({
_id: mongoose.Types.ObjectId,
@@ -39,4 +39,4 @@ const dishSchema = mongoose.Schema({
vegetarian: Boolean,
});
module.exports = mongoose.model("Dish", dishSchema);
export default mongoose.model("Dish", dishSchema);