Inception is a tool that generates a REST or GraphQL api in Javascript. Inception also offers cloud depoyment tools to easily deploy an API to AWS, GCP, or Azure.
Inception generates an api from an api specification file. You can define an api spec as JSON or as a GraphQL schema.
- Create a file named
apiSpec.gqlorapiSpec.json - Install the api compiler
- In the terminal, run
sigma compile -o my_api - Change into the deployment directory
cd my_api/.deploy - Deploy the api by executing
./linux_deployfor Linux,./macos_deployfor macOS, andStart-Process -FilePath WinDeploy.exefor Windows.
- Create a file named
api_ext.json - Create the root object
{
"endpoints": [],
"variables": []
}- Add an endpoint with the following format for REST apis
{
"route": "/my/custom/route",
"methodFunctions": {
"get": {
"cloudProvider": "aws",
"credentials": {
"accessId": "${{ variables.AWS_ACCESS_ID }}",
"secretKey": "${{ variables.AWS_SECRET_KEY }}",
"roleArn": "${{ variables.AWS_ROLE_ARN }}"
},
"functionArn": "arn:aws:lambda:us-west-2:123456789012:function:my-endpoint-handler"
}
}
}