0.0.12 • Published 5 months ago

ts-grail v0.0.12

Weekly downloads
-
License
-
Repository
-
Last release
5 months ago

Welcome to TS Grail

TS Grail is micro framework invented for building simple serverless applications fast. I want to make applications cloud agnostic as much as possible. So once written application should be deployable easily to all hyperscaler cloud providers.

The purpose of this package is to also be able develop apps locally without need of deployment during the development.

Quick start

Overview

I wanted to make sure there will be as little of boilerplate as possible so I came up with that solution:

class GetProducts extends ServerlessFunction {
  // Specyfing the type of trigger and it's properties
  trigger = new RestApiTrigger("/products", HttpMethods.GET);

  // environment variables
  environment = { key: "value" };

  // Name of folder containing the handler file
  folderName = "functions";

  // Name of file with the logic
  handlerName = "handler";
}

// gathering all resources
export const resources = [new GetProducts()];

// Creation of the stack
new GrailStack("GrailStack", CloudProviders.AWS, resources, {});

Create project structure

npx ts-grail --init

After that you should see basic structure created, and first example shown in main.ts

Deploy resources to AWS

ts-grail deploy aws

or

ts-grail deploy aws --profile name-of-the-profile

or in case of AWS you can use cdk command:

cdk deploy --app "npx ts-node --prefer-ts-exts main.ts" --profile name-of-the-profile
0.0.12

5 months ago

0.0.10

7 months ago

0.0.11

7 months ago

0.0.9

7 months ago

0.0.8

7 months ago

0.0.7

7 months ago

0.0.6

7 months ago

0.0.5

7 months ago

0.0.4

7 months ago

0.0.3

7 months ago

0.0.2

7 months ago

0.0.1

7 months ago