File tree 6 files changed +2211
-1
lines changed
6 files changed +2211
-1
lines changed Original file line number Diff line number Diff line change 1
1
ESP32-Glove /.devcontainer
2
2
ESP32-Glove /.vscode
3
- ESP32-Glove /.build
3
+ ESP32-Glove /.build
4
+ Web-Post-Server /node_modules
5
+ Web-Post-Server /.env
6
+ .DS_Store
Original file line number Diff line number Diff line change
1
+ require ( 'dotenv' ) . config ( ) ;
2
+
3
+ const routes = require ( './routes/routes' )
4
+
5
+ const express = require ( 'express' ) ;
6
+ const mongoose = require ( 'mongoose' ) ;
7
+ const mongoString = process . env . DATABASE_URL ;
8
+
9
+ mongoose . connect ( mongoString ) ;
10
+ const database = mongoose . connection ;
11
+
12
+ database . on ( 'error' , ( error ) => {
13
+ console . log ( error )
14
+ } )
15
+
16
+ database . once ( 'connected' , ( ) => {
17
+ console . log ( 'Database Connected' ) ;
18
+ } )
19
+ const app = express ( ) ;
20
+
21
+ app . use ( express . json ( ) ) ;
22
+ app . use ( '/api' , routes )
23
+ app . use ( express . urlencoded ( { extended : true } ) ) ;
24
+
25
+ app . listen ( 3000 , ( ) => {
26
+ console . log ( `Server Started at ${ 3000 } ` )
27
+ } )
Original file line number Diff line number Diff line change
1
+ const mongoose = require ( 'mongoose' ) ;
2
+
3
+ const dataSchema = new mongoose . Schema ( {
4
+
5
+
6
+ TimeStamp : {
7
+ required : true ,
8
+ type : Date
9
+ } ,
10
+
11
+ IMUData : {
12
+ require : true ,
13
+ type : Number
14
+
15
+ }
16
+ } )
17
+
18
+ module . exports = mongoose . model ( 'Data' , dataSchema )
You can’t perform that action at this time.
0 commit comments