Merge branch 'main' into development
This commit is contained in:
@@ -8,7 +8,6 @@ const categoryConverter = new CategoryConverterUseCase({categoriesMapping});
|
||||
|
||||
module.exports = async function app(domain){
|
||||
const category = await getCategory.execute(domain)
|
||||
console.log(category)
|
||||
const categoryConverted = await categoryConverter.execute(category)
|
||||
console.log(categoryConverted)
|
||||
return categoryConverted
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
const dgram = require('dgram');
|
||||
const client = dgram.createSocket('udp4');
|
||||
|
||||
const message = 'bet365.com';
|
||||
const message = 'www.facebook.com';
|
||||
|
||||
const serverHost = 'localhost';
|
||||
const serverPort = 3000;
|
||||
// const serverHost = '34.116.211.192';
|
||||
// const serverPort = 3000;
|
||||
|
||||
// const serverHost = '209.97.181.89';
|
||||
// const serverPort = 33333;
|
||||
|
||||
// const serverHost = 'localhost';
|
||||
// const serverPort = 41234;
|
||||
const serverHost = 'localhost';
|
||||
const serverPort = 33333;
|
||||
|
||||
|
||||
client.send(message, 0, message.length, serverPort, serverHost, (err) => {
|
||||
|
||||
@@ -26,15 +26,17 @@ server.on('message', async (msg, rinfo) => {
|
||||
console.log(`Server got: ${msg} from ${rinfo.address}:${rinfo.port}`);
|
||||
|
||||
const strMsg = msg.toString()
|
||||
const categories = await app(strMsg)
|
||||
let categories = await app(strMsg)
|
||||
|
||||
let result = {}
|
||||
|
||||
categories = categories.map(category => parseInt(category))
|
||||
|
||||
if (categories)
|
||||
result = {
|
||||
result: categories
|
||||
}
|
||||
|
||||
console.log(result)
|
||||
server.send(JSON.stringify(result), rinfo.port, rinfo.address, (err) => {
|
||||
if (err) server.close();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user