0.4.9 β€’ Published 2 years ago

create-serverless-api v0.4.9

Weekly downloads
-
License
MIT License
Repository
github
Last release
2 years ago

Create Serverless API

Create Serverless APIs with no infra configuration.

It is an aws serverless-based backend api template created for beginners.

You can service api without knowing the cloud infrastructure.

And Create Serverless API works on macOS, Windows, and Linux.

Create Serverless API was inspired by the create-react-app.

πŸš€Quick Overview

πŸ“Œ Before we proceed with the work below, you must set aws credential

```
npx create-serverless-api my-api
cd my-api
npm bootstrap
npm deploy
```

And check the API document URL and API endpoint at the terminal.

You will have a fully operational api service.

For detail, please refer to the explanation below.

✨Feature

  • Automatic aws infrastructure completion through documents in the OpenAPI specification.
  • Install only essential packages for each API.

Detail Feature

πŸ‘ The detail feature roughly say that this package is very cool.

  • Infrastructure distribution through IaC makes it easy to modify.
  • Using FaaS, monitoring is easy and stability can be obtained by horizontal expansion.
  • Supports monitoring and logging with aws X-ray and aws CloudWatch.
  • Babel settings are set for using typescript.
  • Can execute local test similar to the aws lambda.
  • Swagger api documents are automatically serviced on the web.

Environment in Lambda Container

βœ… You can customize this.

  • Node 14.x

Detail Usage

  • ⚠ Caution

    Following this usage, your api will be serviced as a cloud service. You spend money according to the amount of api calls. so make sure to check out AWS Pricing Policy.

  1. Login to aws console

  2. Make iam user through aws IAM users.

    • Need Access key credential type.
    • Recommend AdministratorAccess policy through the attachment policies directy button for easy work.
    • Save the access key ID and secret access key that came out like that.
  3. Configurate your aws credentials file

    βœ… Windows default path: C/Users/{userName}/.aws/credentials

    βœ… Linux or macOS default path: ~/.aws/credentials

    [development]
    aws_access_key_id={your_aws_access_key_id}
    aws_secret_access_key={your_aws_secret_access_key}
    
    [production]
    aws_access_key_id={your_aws_access_key_id}
    aws_secret_access_key={your_aws_secret_access_key}

    πŸ“Œ If you want to change the name, please change it with the script of package.json

  4. Creating an API

    npx create-serverless-api my-api
  1. Go the project directory.

    cd my-api
  1. Bootstrap for aws deployment.

    // Development
    npm run bootstrap
    
    // Production
    npm run bootstrap-prod
  2. Deploy to aws

    βœ… The api is served on the address output to the terminal, so make sure to save it.

    // Development
    npm run deploy
    
    // Production
    npm run deploy-prod
  • Local execute

    npm run offline
  • Destroy the api

    // Development
    npm run destroy
    
    // Production
    npm run destroy-prod
  • src directory tree description

    /your-project
    └─src
      β”œβ”€api
      β”‚ └─...
      └─modules
        β”œβ”€...
    • api

      Directory where the entry point of your API is saved.

      The position should be placed in the x-cdk-lambda-handler of swagger.yaml.

    • api

      A directory that puts the code that we use in common.

πŸ‘ Contributing

Pull requests and 🌟 stars are always welcome.

For major changes, please open an issue first to discuss what you would like to change.

β˜• Donate

πŸ“© Contact

awmaker@kakao.com

Others

πŸ‘ We recommend third-party services that suit the characteristics of serverless services.

  • We recommand Dash Bird service for watch lambda infomations.
  • We recommand Planet Scale service for database server.
0.4.9

2 years ago

0.4.8

2 years ago

0.4.5

2 years ago

0.4.7

2 years ago

0.4.1

2 years ago

0.4.3

2 years ago

0.4.2

2 years ago

0.4.0

2 years ago

0.3.12

2 years ago

0.3.11

2 years ago

0.3.10

2 years ago

0.3.9

2 years ago

0.3.8

2 years ago

0.3.7

2 years ago

0.3.5

2 years ago

0.3.4

2 years ago

0.3.3

2 years ago

0.3.2

2 years ago

0.3.1

2 years ago

0.3.0

2 years ago

0.2.3

2 years ago

0.2.2

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.16

2 years ago

0.1.15

2 years ago

0.1.14

2 years ago

0.1.13

2 years ago

0.1.12

2 years ago

0.1.11

2 years ago

0.1.10

2 years ago

0.1.9

2 years ago

0.1.8

2 years ago

0.1.7

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago

0.0.0

2 years ago

1.0.0

2 years ago