Back

[SOLVED] creating a cloud function using node js support typescript?

  • 1
  • Self Hosted
Mosh Ontong
17 Nov, 2023, 04:57

Is it possilbe to have ts? filename in node js template function

TL;DR
There is a solution for creating a cloud function using Node.js with Typescript support. You can use Bun, which supports Typescript out of the box. However, if you're self-hosting your Appwrite instance, Bun is not available in the cloud yet. In order to run functions using Typescript, follow these steps: 1. Check out this link for more information: https://appwrite.io/docs/products/functions/development 2. Use the provided entry point: `dist/main.js` 3. Set the build command as: `npm install && npm build` 4. Select the Node.js runtime for your cloud function 5
Drake
17 Nov, 2023, 05:17

huh?

Mosh Ontong
17 Nov, 2023, 06:06

I mean typescript file type?

Mosh Ontong
17 Nov, 2023, 06:06

like I want to convert this all js into typescript

Mosh Ontong
17 Nov, 2023, 06:07

I am using node js runtime cloud function

Ketan
17 Nov, 2023, 09:57

To run function using TypeScript, you have to select node runtime

Ketan
17 Nov, 2023, 09:58

Also you have to set the following npm install && npm build as build command

Ketan
17 Nov, 2023, 09:58

entry point -> dist/main.js build command -> npm install && npm build

Guille
17 Nov, 2023, 12:04

Or you can use bun, which support typescript out of the box. At the moment, only if you're self hosting your appwrite instance, cloud haven't bun available yet

Mosh Ontong
17 Nov, 2023, 12:31

I tried bun but so hassle in windows platform

Guille
17 Nov, 2023, 12:44

but for cloud function you won't have problem πŸ€” You can have linux subsystem in windows 10 and 11, if you want run bun for developing

Mosh Ontong
10 Dec, 2023, 12:20

[SOLVED] creating a cloud function using node js support typescript?

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more