Skip to content

Instantly share code, notes, and snippets.

View theiasapidecv's full-sized avatar

NUBIX theiasapidecv

View GitHub Profile
const express = require('express')
const bodyParser = require('body-parser')
const https = require('https')
const app = express()
app.use((req, res, next) => {
if (req.headers['x-amz-sns-message-type']) {
req.headers['content-type'] = 'application/json; charset=UTF-8';
}
from flask import Flask
from flask import request as req
app = Flask(__name__)
@app.route('/', methods = ['POST'])
def example():
try:
message = json.loads(req.data)
except:
<?php
$postBody = file_get_contents('php://input');
$message = json_decode($postBody, true);
if ($message) {
$type = $message['Type'];
if (strcmp($type, 'SubscriptionConfirmation') == 0) {
file_get_contents($message['SubscribeURL']);
} elseif (strcmp($type, 'Notification') == 0) {
$subject = $message['Subject'];