Compare commits

...

2 Commits

Author SHA1 Message Date
Konstantinos Kamaropoulos e45565d45e feat: Enable CORS 5 years ago
Konstantinos Kamaropoulos 748679e1fc feat: Add gps_data field to the stored data 5 years ago
  1. 1
      src/logs/logs.interface.ts
  2. 1
      src/logs/logs.service.ts
  3. 1
      src/main.ts
  4. 1
      src/schemas/logs.schema.ts

1
src/logs/logs.interface.ts

@ -4,6 +4,7 @@ export interface ILogs {
_id?: number;
drone_id: number;
gprmc: String;
gps_data: Object;
sensorReadings: Object;
createdAt?: Date;
updatedAt?: Date;

1
src/logs/logs.service.ts

@ -18,6 +18,7 @@ export class LogsService {
const storedLog = new this.logsModel({
drone_id: data["id"],
gprmc: data["GPRMC"],
gps_data: data["gps_data"],
sensorReadings: data["sensorReadings"]
});
let id = await storedLog.save();

1
src/main.ts

@ -3,6 +3,7 @@ import { AppModule } from './app.module';
async function bootstrap() {
const app = await NestFactory.create(AppModule);
app.enableCors();
await app.listen(3000);
}
bootstrap();

1
src/schemas/logs.schema.ts

@ -3,5 +3,6 @@ import * as mongoose from 'mongoose';
export const LogsSchema = new mongoose.Schema({
drone_id: { type: Number },
gprmc: { type: String },
gps_data: { type: Object },
sensorReadings: { type: Object }
}, { timestamps: true });

Loading…
Cancel
Save