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 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'; | |
} |
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
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: |
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 | |
$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']; |