Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto add functions based on glob pattern #104

Open
mildronize opened this issue Jan 5, 2024 · 0 comments
Open

Auto add functions based on glob pattern #104

mildronize opened this issue Jan 5, 2024 · 0 comments

Comments

@mildronize
Copy link
Collaborator

mildronize commented Jan 5, 2024

Propose APIs

app.addFunctionsFromPaths('functions/*.ts');

Note, using glob pattern might be more convenient way to add function endpoint into Nammatham app, however, it may lose something:

  • Type-safe End-to-end from backend to frontend by extract type from NammathamApp, however, during my plan this is overlapping the same thing that tRPC does, so, this may be don't care.
  • Bundling ESM Tree Handshaking, right now Azure Functions v4 and Nammatham v2 (Make sure Azure Functions Adapter can bundle  #110) doesn't app bundling yet, considering issues later when those issues is fixed.

Example:

import { initNammatham } from '@nammatham/core';
import { AzureFunctionsAdapter } from '@nammatham/azure-functions';

const n = initNammatham.create(new AzureFunctionsAdapter());
export const app = n.app;

app.addFunctionsFromPaths('functions/*.ts');

app.start();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant