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 React, { useEffect, useState } from 'react'; | |
// Set this to your public ReCAPTCHA client key | |
const RECAPTCHA_SITE_KEY = 'YOUR_KEY_HERE'; | |
// Set this to your backend URL that verifies ReCAPTCHA tokens | |
const RECAPTCHA_VERIFY_URL = 'http://www.mocky.io/v2/5e88253631000025303f4835'; | |
/** | |
* Sends a request to your server to verify the given token |
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
// Actions | |
export const ADD_TOAST = "ADD_TOAST"; | |
export const DISMISS_TOAST = "DISMISS_TOAST"; | |
// Action Creator | |
export function addToast(toast) { | |
toast = { ...toast, id: Math.random() }; | |
return function(dispatch) { | |
dispatch({ | |
type: ADD_TOAST, |
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
$postBody = [ | |
'test' => 'test' | |
]; | |
$baseUrl = 'http://localhost:4000'; | |
$ch = curl_init(); | |
curl_setopt($ch, CURLINFO_HEADER_OUT, TRUE); | |
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); | |
curl_setopt($ch, CURLOPT_HEADER, TRUE); |
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
var express = require('express'); | |
var session = require('express-session'); | |
var cookieParser = require('cookie-parser'); | |
var flash = require('connect-flash'); | |
var app = express(); | |
app.use(cookieParser('secret')); | |
app.use(session({cookie: { maxAge: 60000 }})); | |
app.use(flash()); |