Skip to content

Commit 5fdeb82

Browse files
committed
some changes
1 parent 1a6ebc6 commit 5fdeb82

File tree

4 files changed

+23
-8
lines changed

4 files changed

+23
-8
lines changed

CRUD API's/app.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ const express=require('express');
22
const bodyparser=require('body-parser');
33
const mongoose=require('mongoose');
44
const dburl=require('./database/myurl.js');
5+
const Note= require('./')
56

67
//create express app
78
const app=express();

CRUD API's/app/models/model.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
const mongoose=require('mongoose');
2+
3+
//defining schema
4+
const noteSchema=mongoose.Schema({
5+
title:{
6+
type: string,
7+
require: true
8+
},
9+
author:{
10+
type: String,
11+
require: true
12+
},
13+
content:{
14+
type : string,
15+
require: true
16+
}
17+
},
18+
{
19+
timestamp: true
20+
});
21+
22+
module.exports=mongoose.model('Note',noteSchema);

CRUD API's/database/app/models/model.js

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)