Podpora za srije modele in controllereje skupaj
This commit is contained in:
@@ -1,11 +0,0 @@
|
||||
var mongoose = require('mongoose');
|
||||
var Schema = mongoose.Schema;
|
||||
|
||||
var gameSchema = new Schema({
|
||||
'title': String,
|
||||
'released': String,
|
||||
'webImg': String,
|
||||
'code': String
|
||||
});
|
||||
|
||||
module.exports = mongoose.model('game', gameSchema);
|
15
models/mediaModel.js
Normal file
15
models/mediaModel.js
Normal file
@@ -0,0 +1,15 @@
|
||||
var mongoose = require('mongoose');
|
||||
var Schema = mongoose.Schema;
|
||||
|
||||
var mediaSchema = new Schema({
|
||||
'title': String,
|
||||
'released': String,
|
||||
'webImg': String,
|
||||
'code': String
|
||||
});
|
||||
|
||||
module.exports = {
|
||||
MovieModel: mongoose.model('movie', mediaSchema),
|
||||
SeriesModel: mongoose.model('series', mediaSchema),
|
||||
GameModel: mongoose.model('game', mediaSchema)
|
||||
};
|
@@ -1,11 +0,0 @@
|
||||
var mongoose = require('mongoose');
|
||||
var Schema = mongoose.Schema;
|
||||
|
||||
var movieSchema = new Schema({
|
||||
'title': String,
|
||||
'released': String,
|
||||
'webImg': String,
|
||||
'code': String
|
||||
});
|
||||
|
||||
module.exports = mongoose.model('movie', movieSchema);
|
Reference in New Issue
Block a user