15 lines
No EOL
304 B
JavaScript
15 lines
No EOL
304 B
JavaScript
const mongoose = require('mongoose')
|
|
|
|
const blogSchema = mongoose.Schema({
|
|
title: String,
|
|
author: String,
|
|
url: String,
|
|
likes: Number,
|
|
})
|
|
|
|
const Blog = mongoose.model('Blog', blogSchema)
|
|
|
|
const mongoUrl = 'mongodb://localhost/bloglist'
|
|
mongoose.connect(mongoUrl)
|
|
|
|
module.exports = {models: {Blog}} |