⛅ Cloudflare Workers as a Web Server (with Webpack)

Поделиться
HTML-код
  • Опубликовано: 22 янв 2025

Комментарии • 26

  • @rambosweat
    @rambosweat 3 года назад +4

    for anybody else having this issue:
    might be worth noting that the latest version of html-loader will break with "getOptions is not a function" messages when running wrangler preview --watch.
    I have found installing "html-loader": "1.0.0-alpha.0" and clearing out node_modules, and removing yarn.lock, works.
    Edit: what is the 2021 solution to the above problem?

    • @JoelCodes
      @JoelCodes  3 года назад

      That is interesting to know. Let me know if you find a better solution to this.

    • @xali2008
      @xali2008 3 года назад

      @@JoelCodes html-loader version 2 needs webpack v5, Wrangler's built-in webpack is v4, if you want to use webpack v5 you can use custom builds in your wrangler.toml.
      here's a guide for how to setup custom builds.
      developers.cloudflare.com/workers/cli-wrangler/configuration#build

    • @DanTovbein
      @DanTovbein 3 года назад +1

      Any idea of solving this issue?

    • @dvz131
      @dvz131 3 года назад

      Thank you!

    • @maazmusa3192
      @maazmusa3192 2 года назад

      any idea how to solve the html loader issue?

  • @JoeBourne_UK
    @JoeBourne_UK 3 года назад

    Short and sweet, exactly what I've been looking for. I have a bunch of unused domain names and was looking for a free hosting plan to create parking pages for them. This looks perfect!

    • @JoelCodes
      @JoelCodes  2 года назад +1

      Ya I am really liking cloudflare workers. Highly recommend them!

  • @jame_sta
    @jame_sta 4 года назад +3

    Great videos! More Cloudfare Worker videos please :D

    • @JoelCodes
      @JoelCodes  4 года назад +1

      I'm working on them as we speak! I recently moved and it has been taking up all my free time. But they'll be coming again soon!
      Cheers 🍻

  • @electrolyteorb
    @electrolyteorb 3 года назад

    Very high quality

    • @JoelCodes
      @JoelCodes  2 года назад

      Thanks! Much appreciated!

  • @wobsoriano
    @wobsoriano 4 года назад +1

    Really cool!

    • @JoelCodes
      @JoelCodes  4 года назад

      It definitely is! I'm pretty excited for the Cloudflare Workers platform.

  • @monireol
    @monireol 3 года назад +2

    Good

  • @SriHarshaChilakapati
    @SriHarshaChilakapati 4 года назад +1

    You probably don't want to re-create the router every time a request comes right?

    • @JoelCodes
      @JoelCodes  4 года назад +1

      You know, that's a really good question. I don't know the answer to that. Their example shows the router being created on each handle of request. It seems like it would be more efficient outside. My guess is optimization wouldn't improve the response times. More testing is required.

    • @SriHarshaChilakapati
      @SriHarshaChilakapati 4 года назад +1

      @@JoelCodes Let's say that you're getting 10 requests in parallel, then you're creating 10 routers at the same time. How does it go for scale? Although, more testing is indeed required since I don't know how many workers are being spawned and how many requests are given to each worker.

    • @JoelCodes
      @JoelCodes  4 года назад +1

      @@SriHarshaChilakapati I'm with you on this. Makes total since. Definitely have to test this.

    • @SriHarshaChilakapati
      @SriHarshaChilakapati 4 года назад +1

      @@JoelCodes Would love to see testing these things in your future videos.

    • @JoelCodes
      @JoelCodes  4 года назад

      @@SriHarshaChilakapati I'll keep that in mind. I have two more videos planned for Cloudflare Workers. I'll have to think of some more after those.