Skip to content

Commit

Permalink
Creación de modelos
Browse files Browse the repository at this point in the history
  • Loading branch information
adrian_vidal committed Sep 22, 2021
1 parent b3f27ea commit eb4915a
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 0 deletions.
16 changes: 16 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
var express = require('express')
var bodyParser = require('body-parser')

var app = express()

// Archivos de rutas

// Middleware
app.use(bodyParser.urlencoded({extended:false}))
app.use(bodyParser.json())

// CORS

// Rutas

module.exports = app
12 changes: 12 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
var mongoose = require('mongoose')
var app = require('./app')
var port = 3700

mongoose.Promise = global.Promise;
mongoose.connect('mongodb://localhost:27017/portfolio')
.then(() => {
app.listen(port, () => {
console.log('Servidor funcionando correctamente en la url: http://localhost/3700')
})
})
.catch(err => console.log(err))
12 changes: 12 additions & 0 deletions models/education.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
var mongoose = require('mongoose')
var Schema = mongoose.Schema

var educationSchema = Schema({
name: String,
description: String,
startDate: String,
endDate: String,
icon: String
})

module.exports = mongoose.model('Education', educationSchema)
13 changes: 13 additions & 0 deletions models/job.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
var mongoose = require('mongoose')
var Schema = mongoose.Schema()

var jobSchema = Schema({
name: String,
description: String,
startDate: String,
endDate: String,
tecnologies: [String],
icon: String
})

module.exports = mongoose.model('Job', jobSchema)
12 changes: 12 additions & 0 deletions models/tecnology.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
var mongoose = require('mongoose')
var Schema = mongoose.Schema

var tecnologySchema = Schema({
name: String,
description: String,
state: String,
category: String,
icon: String
})

module.exports = mongoose.model('Tecnology', tecnologySchema)

0 comments on commit eb4915a

Please sign in to comment.