.js
and .ts
files inside of the ./functions
folder of your project and Nhost takes care of deploying your functions as part of a Deployment.
To deploy Nhost Functions, your project needs to be connected to a GitHub repository.
Nhost Functions
./functions/hello.js
Folders and filenames prepended with an underscore are not exposed. This is useful, for example, for utility functions that you want to share across multiple functions.
Endpoints
Functions are exposed through HTTP endpoints generated based on the contents of./functions
:
File | HTTP Endpoint |
---|---|
functions/index.js | https://[subdomain].functions.[region].nhost.run/v1/ |
functions/users/index.ts | https://[subdomain].functions.[region].nhost.run/v1/users |
functions/users/active.ts | https://[subdomain].functions.[region].nhost.run/v1/users/active |
functions/my-company.js | https://[subdomain].functions.[region].nhost.run/v1/my-company |
Folders and filenames prepended with an underscore are not exposed. This is useful, for example, for utility functions that you want to share across multiple functions.