We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1a6ebc6 commit 5fdeb82Copy full SHA for 5fdeb82
CRUD API's/app.js
@@ -2,6 +2,7 @@ const express=require('express');
2
const bodyparser=require('body-parser');
3
const mongoose=require('mongoose');
4
const dburl=require('./database/myurl.js');
5
+const Note= require('./')
6
7
//create express app
8
const app=express();
CRUD API's/app/models/model.js
@@ -0,0 +1,22 @@
1
+const mongoose=require('mongoose');
+
+//defining schema
+const noteSchema=mongoose.Schema({
+ title:{
+ type: string,
+ require: true
+ },
9
+ author:{
10
+ type: String,
11
12
13
+ content:{
14
+ type : string,
15
16
+ }
17
+},
18
+{
19
+ timestamp: true
20
+});
21
22
+module.exports=mongoose.model('Note',noteSchema);
CRUD API's/database/app/routes/routes.js CRUD API's/app/routes/routes.jsCRUD API's/database/app/routes/routes.js renamed to CRUD API's/app/routes/routes.js
CRUD API's/database/app/models/model.js
0 commit comments