HamishMW/portfolio

Need little help in setting up contact us page

siddharthdeo99 opened this issue · 3 comments

How to implement that fetch API for taking input from users and store in the database??

I set up the API for the contact page using a serverless function. You can find the source code for it under functions/index.js. It doesn't store anything in a database, just basically takes the form data and sends it to an email address using Amazon SES. There's a bunch of extra configuration you need to do for Amazon SES, so I'd recommend using Nodemailer and some smtp credentials instead (this is how I had it set up previously, you can see the function using nodemailer in an older commit).

As for hosting the function I'm using AWS lambda, set up with serverless. The config is under functions/serverless.yml. You'll need an AWS account, but once that's set up you can run npm run deploy:api from the /functions directory and it'll automatically set everything up in AWS and spit out a url for the lambda function that you can paste into that fetch request.

hamishMW im not getting serverless function can u please step by step guid or any video

im getting message failed send mail what extra configuration you need to do for Amazon SES,