Compare commits
11 Commits
cors
...
docker-imp
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5e98348cac | ||
|
|
3bf4cebbe6 | ||
|
|
907c24c45b | ||
|
|
b057ea154a | ||
|
|
0e2a7eeeec | ||
|
|
c702946393 | ||
|
|
5260b8a9c5 | ||
|
|
30bd7a0d28 | ||
| 32ea0d7c4d | |||
| c22d1b5b8c | |||
| 15fe566d53 |
@@ -1,5 +1,4 @@
|
|||||||
PORT=3101
|
PORT=3101
|
||||||
branch=
|
|
||||||
DATABASE_URL=postgres://greact:pG3526l4@194.36.208.86:5433/cloud
|
DATABASE_URL=postgres://greact:pG3526l4@194.36.208.86:5433/cloud
|
||||||
|
|
||||||
# Optional. When set, POST /api/ingest requires x-api-key: <value>.
|
# Optional. When set, POST /api/ingest requires x-api-key: <value>.
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
services:
|
services:
|
||||||
drill-cloud-v3:
|
drill-cloud-v3:
|
||||||
container_name: drill-cloud-v3${branch:+-${branch}}
|
|
||||||
build: .
|
build: .
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
environment:
|
environment:
|
||||||
|
|||||||
@@ -9,15 +9,16 @@ import { IngestService } from './ingest.service';
|
|||||||
export class IngestController {
|
export class IngestController {
|
||||||
constructor(private readonly ingest: IngestService) {}
|
constructor(private readonly ingest: IngestService) {}
|
||||||
|
|
||||||
/** Принимает одну сырую точку и сохраняет ее как запись истории/current. */
|
|
||||||
@Post()
|
@Post()
|
||||||
ingestPoint(@Body() point: IngestPointDto) {
|
ingestPoint(@Body() point: IngestPointDto) {
|
||||||
return this.ingest.ingestPoint(point);
|
return this.ingest.ingestPoint(point);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Принимает компактное тело запроса по edge и сохраняет каждое значение построчно. */
|
|
||||||
@Post(':edge')
|
@Post(':edge')
|
||||||
ingestEdgeValues(@Param('edge') edge: string, @Body() body: IngestEdgeValuesDto) {
|
ingestEdgeValues(
|
||||||
|
@Param('edge') edge: string,
|
||||||
|
@Body() body: IngestEdgeValuesDto,
|
||||||
|
) {
|
||||||
const points = Object.entries(body.values).map(([tag, value]) => ({
|
const points = Object.entries(body.values).map(([tag, value]) => ({
|
||||||
edge,
|
edge,
|
||||||
tag,
|
tag,
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ import { NestFactory } from '@nestjs/core';
|
|||||||
import compression from 'compression';
|
import compression from 'compression';
|
||||||
import { AppModule } from './app.module';
|
import { AppModule } from './app.module';
|
||||||
|
|
||||||
/** Запускает HTTP API со сжатием и глобальной валидацией DTO. */
|
|
||||||
async function bootstrap() {
|
async function bootstrap() {
|
||||||
const app = await NestFactory.create(AppModule);
|
const app = await NestFactory.create(AppModule);
|
||||||
app.use(compression());
|
app.use(compression());
|
||||||
|
|||||||
Reference in New Issue
Block a user