Skip to content
Init is here / May 19 - 23
Back

Can I use my html page in functions?

  • 0
  • Functions
  • Web
  • Storage
  • Cloud
Waldemar
15 Feb, 2024, 13:59

Hello, is it possible to send my HTML page so that it is displayed in the functions responses?

TL;DR
Developers are discussing how to host a complete website on Appwrite without relying on external services. A developer shared a function that serves HTML, CSS, and JS files and mentioned the need to set up the function to serve all files similarly to index.html. Another developer asked if they can host their complete website on Appwrite and was informed that it's possible. They also mentioned using Firebase hosting with Appwrite. Ultimately, developers are exploring options for displaying HTML pages in function responses.
Steven
15 Feb, 2024, 19:49

yup. we have some function templates that demo that like the node prompt chatGPT one

Waldemar
16 Feb, 2024, 00:35

Can I send my complete website, also the Firebase hosting?

Steven
16 Feb, 2024, 01:07

Are you asking if you can use firebase hosting with Appwrite? Sure. It doesn't matter where you deploy your client app

Waldemar
16 Feb, 2024, 14:30

No, I would like to know if I can host my complete website on appwrite itself, without depending on external services, it would be interesting to have all-in-one on appwrite

Steven
16 Feb, 2024, 14:31

Technically, yes

Waldemar
16 Feb, 2024, 14:32

this is quite interesting... Where can I find an example of how to do exactly this?

Steven
16 Feb, 2024, 14:33

Did you look at this?

Waldemar
16 Feb, 2024, 14:33

I will look now

Waldemar
16 Feb, 2024, 14:45

From what I saw here, will I have to embed all css and js within an index.html?

Kenny
16 Feb, 2024, 15:14

If you want code separation you'll need to setup your function to also serve the js and css files, similar to how it serves up the index.html file on a get request.

Kenny
16 Feb, 2024, 15:16

If you want you can take a look at a function I've done that does serve html,css, and js files.

https://github.com/dishwasher-detergent/screenshot/blob/main/functions/screenshot/src/pages/home.ts

Kenny
16 Feb, 2024, 15:16

Though it does use Hono, to assist in this.

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