This file contains hidden or 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
| # Credit to John Creecy | |
| # Original can be found at https://gist.github.com/zugdud/b39eea02faa6926305f57fbde8d31b68 | |
| AWSTemplateFormatVersion: '2010-09-09' | |
| Description: OpenVPN Stack | |
| Parameters: | |
| OpenVPNPort: | |
| Type: Number | |
| Default: 1194 |
This file contains hidden or 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
| # Credit to John Creecy | |
| # Original can be found at https://gist.github.com/zugdud/f5453af2c827eba38bb036b19e10b371 | |
| AWSTemplateFormatVersion: '2010-09-09' | |
| Description: OpenVPN Stack | |
| Parameters: | |
| OpenVPNPort: | |
| Type: Number | |
| Default: 1194 |
This file contains hidden or 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
| # Credit to John Creecy | |
| # Original can be found at https://gist.github.com/zugdud/0bf8b2bab65ede19dc42a58d2db721a4 | |
| AWSTemplateFormatVersion: '2010-09-09' | |
| Description: OpenVPN Stack | |
| Parameters: | |
| OpenVPNPort: | |
| Type: Number | |
| Default: 1194 |
This file contains hidden or 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
| fetch(lambdaRequest) | |
| .then(response => console.log(response)) | |
| .catch(err => console.log(err)); |
This file contains hidden or 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 lambdaRequest = new Request(endpoint, { | |
| method: 'POST', | |
| mode: 'no-cors', | |
| body: JSON.stringify(body) | |
| }); |
This file contains hidden or 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 body = { | |
| email: formEmail, | |
| subject: formSubject, | |
| message: formMessage | |
| } |
This file contains hidden or 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 endpoint = 'https://your-api-gateway-endpoint.com/ContactFormLambda'; |
This file contains hidden or 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 formEmail = document.querySelector('.form-email').value; | |
| var formSubject = document.querySelector('.form-subject').value; | |
| var formMessage = document.querySelector('.form-message').value; |
This file contains hidden or 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
| document.getElementById('serverless-contact-form').addEventListener('submit', sendDataToLambda); |
This file contains hidden or 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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>My Contact Form Microservice</title> | |
| <style> | |
| /* It's not pretty, but it'll do :) */ | |
| input, | |
| textarea { | |
| display: block; | |
| margin: 20px; |