https://github.com/ribbinpo/functiongraph-node-poc
Template: expressjs for HTTP format on FunctionGraph (Huawei Cloud)
https://github.com/ribbinpo/functiongraph-node-poc
cloudfunctions express-validator expressjs makefile template
Last synced: 9 months ago
JSON representation
Template: expressjs for HTTP format on FunctionGraph (Huawei Cloud)
- Host: GitHub
- URL: https://github.com/ribbinpo/functiongraph-node-poc
- Owner: ribbinpo
- Created: 2024-04-03T05:52:52.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-02T09:38:58.000Z (over 1 year ago)
- Last Synced: 2025-03-14T03:44:44.519Z (12 months ago)
- Topics: cloudfunctions, express-validator, expressjs, makefile, template
- Language: TypeScript
- Homepage:
- Size: 62.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Huawei CloudFunction POC with FunctionGraph
This repository contains a Proof of Concept (POC) for implementing cloud functions in Huawei Cloud using the FunctionGraph feature.
The project is structured with Node.js, Express.js, and TypeScript. Each function is developed separately within the `functions/` directory,
while shared code, configurations, and adapters reside in the `shares/` directory. Additionally, a Makefile is provided to facilitate building cloud function, followed by compressing them into a zip file for upload to FunctionGraph or build to docker image for push to container registry then sync with FunctionGraph.
## Project Structure
```bash
.
├── functions/ # Directory for individual cloud functions
│ ├── function1/ # Function 1
│ ├── function2/ # Function 2
│ └── ... # Other functions
├── shares/ # Shared code, config, adapter
├── index.ts # Run every module to the monolith
├── Makefile # Makefile for building and compressing functions
└── README.md # This file
```
## Getting Started
To deploy functions to Huawei CloudFunction using FunctionGraph, follow these steps:
Install dependencies:
```sh
npm install
```
Init new module
```sh
make init function=[function_name]
```
Create a new module to `functions/` using `templates/` module to a template. (so you can modify your template in this module)
Build and compress functions:
```sh
make build function=[function_name]
```
Once the build process is complete, upload the generated zip files to FunctionGraph using the Huawei Cloud Console.
```sh
make build-all
```
It similar with `make build` but this command will build every module in `functions/` and zip to `out/` folder.