esm.sh
esm.sh copied to clipboard
Self hosting
I have 2 suggestions:
- Can you tell us more about how to do self hosting such as using docker?
- It is possible to develop a project in node.js ? The reason is because many users are front-end engineer, they are familiar with javascript and node.js.
- They directions in the readme should really be changed to
$ git clone https://github.com/postui/esm.sh
$ cd esm.sh
$ sh ./scripts/build.sh
$ ./scripts/esmd -dev -domain localhost
This is only really help you if you change your source files to look for https://localhost/....
Getting this setup as a proxy to esm.sh is a major pain though. I got up to the point where I used import_maps.json to fool deno into going to localhost for esh.sh content. But it kept complaining of being unable to send https traffic to an http address. And deno doesn't have any ability to accept invalid certificates. So the only solution is to give localhost a valid certificate. Oh and the catch to that is it can't be both the CA certificate and domain cert at the same time otherwise you get
TypeError: error sending request for url (https://localhost/[email protected]): error trying to connect: invalid certificate: CAUsedAsEndEntity
So you need to have a certificate signed by a CA trusted only your PC.
This is where I gave up trying to get this to run in a local environment lol
@FallingSnow esm.sh use autotls to get let's encrypted's certificate, in dev you should use http://localhost/...
I'm trying to spoof esm.sh to fix some issues in aleph.
there is a offical docker now: https://github.com/esm-dev/esm.sh/pkgs/container/esm.sh