This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require("dotenv").config(); | |
const axios = require("axios"); | |
async function postData(url, res) { | |
try { | |
const options = { | |
url, | |
method: "POST", | |
headers: {"Content-Type": "application/json"}, | |
data: res.body, | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// npm install @elastic/elasticsearch | |
import { Client } from '@elastic/elasticsearch'; | |
const client = new Client({ | |
node: 'https://your-elastic-search-endpoint', | |
auth: { | |
username: 'your-username', | |
password: 'your-password' | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const MongoClient = require('mongodb').MongoClient; | |
const { Client } = require('@elastic/elasticsearch'); | |
const uri = 'mongodb://localhost:27017/mydb'; | |
const dbName = 'mydb'; | |
const collectionName = 'mycollection'; | |
const elasticUrl = 'http://localhost:9200'; | |
const indexName = 'myindex'; | |
exports.handler = async function(event, context) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Siparisler uzerinden islem yapmak icin PUT methoduyla ilgili URL tetiklenirken asagidaki sekilde gerekli fieldlari gonderebilirsiniz | |
* asagidaki ornekte trendyol uzerinde yapilacak islemlerin ornekleri bulunmaktadir. | |
*/ | |
<?php | |
$curl = curl_init(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//webhook olarak vereceginiz URL icerisinde su sekilde bizden veri alabilirsiniz. | |
try { | |
// gelen datayi aliyoruz | |
$requestPayload = file_get_contents('php://input'); | |
// JSON objectini decode ediyoruz. | |
$payload = json_decode($requestPayload); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//database/config.js | |
const mongoose = require('mongoose'); | |
class Database { | |
constructor(options) { | |
this.options = options; | |
this.connect(); | |
} | |
connect() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import threading | |
from queue import Queue | |
import boto3 | |
from pymongo import MongoClient | |
class LogService: | |
def __init__(self): | |
self.client = MongoClient('mongodb://localhost:27017/') | |
self.db = self.client['logs'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { Worker, isMainThread, parentPort } = require('worker_threads'); | |
const WebSocket = require('ws'); | |
const AWS = require('aws-sdk'); | |
const sqs = new AWS.SQS({ | |
region: 'us-west-2', | |
accessKeyId: 'ACCESS_KEY', | |
secretAccessKey: 'SECRET_KEY' | |
}); | |
const queueUrl = 'https://sqs.us-west-2.amazonaws.com/1234567890/my-queue'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//https://gist.github.com/puuble/d501bcdc03fb43499e09553458827c42 part 2 | |
const MongoClient = require('mongodb').MongoClient; | |
const AWS = require('aws-sdk'); | |
const sqs = new AWS.SQS({ | |
region: 'us-west-2', | |
accessKeyId: 'ACCESS_KEY', | |
secretAccessKey: 'SECRET_KEY' | |
}); | |
const queueUrl = 'https://sqs.us-west-2.amazonaws.com/1234567890/my-queue'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const WebSocket = require('ws'); | |
const winston = require('winston'); | |
const logger = winston.createLogger({ | |
level: 'info', | |
format: winston.format.json(), | |
transports: [ | |
new winston.transports.Console() | |
] | |
}); |
NewerOlder