Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BCN-FT-JuliaCanas #32

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions data.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module.exports =
level: 'Amateur Chef',
ingredients: ['1/2 cup rice vinegar', '5 tablespoons honey', '1/3 cup soy sauce (such as Silver Swan®)', '1/4 cup Asian (toasted) sesame oil', '3 tablespoons Asian chili garlic sauce', '3 tablespoons minced garlic', 'salt to taste', '8 skinless, boneless chicken thighs'],
cuisine: 'Asian',
dishType: ['Dish'],
dishType: 'Dish',
image: 'https://images.media-allrecipes.com/userphotos/720x405/815964.jpg',
duration: 40,
creator: 'Chef LePapu'
Expand All @@ -15,7 +15,7 @@ module.exports =
level: 'UltraPro Chef',
ingredients: ['3 1/2 pounds boneless pork shoulder, cut into large pieces', '1 tablespoon freshly ground black pepper', '1 tablespoon kosher salt, or more to taste', '2 tablespoons vegetable oil', '2 bay leaves', '2 teaspoons ground cumin', '1 teaspoon dried oregano', '1/4 teaspoon cayenne pepper', '1 orange, juiced and zested'],
cuisine: 'American',
dishType: ['Dish'],
dishType: 'Dish',
image: 'https://images.media-allrecipes.com/userphotos/720x405/2280918.jpg',
duration: 160,
creator: 'Chef John'
Expand All @@ -25,7 +25,7 @@ module.exports =
level: 'Amateur Chef',
ingredients: ['6 cups grated carrots', '1 cup brown sugar', '1 cup raisins', '4 eggs', '1 1/2 cups white sugar', '1 cup vegetable oil', '2 teaspoons vanilla extract', '1 cup crushed pineapple, drained', '3 cups all-purpose flour', '1 1/2 teaspoons baking soda', '1 teaspoon salt', '4 teaspoons ground cinnamon'],
cuisine: 'International',
dishType: ['Dessert'],
dishType: 'Dessert',
image: 'https://images.media-allrecipes.com/userphotos/720x405/3605684.jpg',
duration: 130,
creator: 'Chef Nadia'
Expand All @@ -35,7 +35,7 @@ module.exports =
level: 'Easy Peasy',
ingredients: ['2 pounds red onions, sliced salt to taste', '2 (16 ounce) boxes uncooked rigatoni', '1 tablespoon chopped fresh marjoram leaves', '1 pinch cayenne pepper', '2 tablespoons freshly grated Parmigiano-Reggiano cheese'],
cuisine: 'Italian',
dishType: ['Dish'],
dishType: 'Dish',
image: 'https://images.media-allrecipes.com/userphotos/720x405/3489951.jpg',
duration: 220,
creator: 'Chef Luigi'
Expand All @@ -45,7 +45,7 @@ module.exports =
level: 'Amateur Chef',
ingredients: ['1/2 cup light brown sugar', '1 large egg', '2 tablespoons milk', '1 1/4 teaspoons vanilla extract', '2 cups semisweet chocolate chips'],
cuisine: 'French',
dishType: ['Dish'],
dishType: 'Dish',
image: 'https://images.media-allrecipes.com/userphotos/720x405/815964.jpg',
duration: 30,
creator: 'Chef Jennifer'
Expand Down
44 changes: 44 additions & 0 deletions models/Recipe.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
'use strict';

const mongoose = require('mongoose');
const Schema = mongoose.Schema; //hace una referencia a Schema para no tener k escribir todo el tiempo mongoose.Schema

//Creamos el schema
const recipeSchema = new Schema({
title: {
type: String,
required: true,
unique: true
},
level: {
type: String,
enum: ['Easy Peasy', 'Amateur Chef', 'UltraPro Chef']
},
ingredients: Array,
cuisine: {
type: String,
required: true
},
dishType: {
type: String,
enum: ['Breakfast', 'Dish', 'Snack', 'Drink', 'Dessert', 'Other']
},
image: {
type: String,
default: 'https://images.media-allrecipes.com/images/75131.jpg'
},
duration: {
type: Number,
min: 0
},
creator: String,
created: {
type: Date,
default: new Date(),
}
});

//creamos el modelo
const Recipe = mongoose.model('Recipe', recipeSchema);

module.exports = Recipe;
Loading