Serverless Framework Node HTTP API on AWS







Step 1 : Clone source code

git clone https://github.com/devmecloud/eco_auth_lampio.git authServices
cd authServices

Step 2 : Create app in Cognito AWS

Link : https://us-east-1.console.aws.amazon.com/cognito/v2/idp/set-up-your-application?region=ap-northeast-1

  • Action create app with application type is  mobile in cognito


  • Copy Client ID change replace all in all source

Step 3 : Install package

npm install

Step 4 : Two case

If you run local then

aws configure
AWS Access Key ID [****************]: your_key
AWS Secret Access Key [****************]: your_key
Default region name [us-east-1]: us-east-1
Default output format [json]: json
cd authServices
sls deploy

After running deploy, you should see output similar to:

Deploying "authService" to stage "dev" (us-east-1)

✔ Service deployed to stack authService-dev  (91s)

endpoints:
  POST - https://s717qokuwe.execute-api.us-east-1.amazonaws.com/signUp
  POST - https://s717qokuwe.execute-api.us-east-1.amazonaws.com/confirmSignUp
  POST - https://s717qokuwe.execute-api.us-east-1.amazonaws.com/sign-in
functions:
  signUp: authService-dev-signUp (2.9 MB)
  confirmSignUp: authService-dev-confirmSignUp (2.9 MB)
  signIn: authService-dev-signIn (2.9 MB)

If you want push code on your github

Setting key aws in github

cd authServices
rm rf .git
git init
git remote add origin your_link_github
git add .
git commit -m "Your commit"
git push origin master

After when push code, then check at Action in github


Step 5 : Test function