Browse Source

add something

main
matthew 2 years ago
parent
commit
071ab5e801
  1. 11
      docker-compose.yml
  2. 4
      searching-front/services/domain-watcher.ts
  3. 4
      searching-front/services/main.ts
  4. 2
      searching-front/services/modules/elastic/index.ts
  5. 9
      searching-front/services/parser.ts

11
docker-compose.yml

@ -18,17 +18,6 @@ services:
- es-net - es-net
ports: ports:
- 9200:9200 - 9200:9200
kibana:
container_name: kb-container
image: kibana:7.17.6
environment:
- ELASTICSEARCH_HOSTS=http://es-container:9200
networks:
- es-net
depends_on:
- elasticsearch
ports:
- 5601:5601
proxy: proxy:
platform: linux/x86_64 platform: linux/x86_64
build: ./proxy build: ./proxy

4
searching-front/services/domain-watcher.ts

@ -1,5 +1,4 @@
import dotenv from "dotenv"
import path from "path"
import tonweb from "tonweb" import tonweb from "tonweb"
import { import {
JettonApi, JettonApi,
@ -11,7 +10,6 @@ import {
WalletApi, WalletApi,
Configuration, Configuration,
} from "tonapi-sdk-js" } from "tonapi-sdk-js"
dotenv.config({ path: path.resolve(__dirname, "../.env.local") })
import db from "../db/index" import db from "../db/index"
import axios from "axios" import axios from "axios"
import { getTonProxy } from "./helpers" import { getTonProxy } from "./helpers"

4
searching-front/services/main.ts

@ -1,7 +1,9 @@
import dotenv from "dotenv"
import path from "path"
dotenv.config({ path: path.resolve(__dirname, "../.env.local") })
import domainWatcher from './domain-watcher' import domainWatcher from './domain-watcher'
import parser from './parser' import parser from './parser'
const run = async()=>{ const run = async()=>{
console.log('Start domain watcher') console.log('Start domain watcher')
await domainWatcher(); await domainWatcher();

2
searching-front/services/modules/elastic/index.ts

@ -44,7 +44,7 @@ class Elastic {
private client: Client private client: Client
constructor() { constructor() {
this.client = new Client({ this.client = new Client({
node: "http://localhost:9200", node: "http://elasticsearch:9200",
}) })
} }

9
searching-front/services/parser.ts

@ -1,12 +1,3 @@
import dotenv from "dotenv"
import path from "path"
import { JSDOM } from "jsdom"
import axios from "axios"
import tinyld from "tinyld"
import languagedetect from "languagedetect"
dotenv.config({ path: path.resolve(__dirname, "../.env.local") })
import db from "../db/index" import db from "../db/index"
import Elastic from "./modules/elastic" import Elastic from "./modules/elastic"
import Parser from "./modules/parser" import Parser from "./modules/parser"

Loading…
Cancel
Save