cknight
cknight16mo ago

Run remote Fresh application code locally.

Is it possible to run a remotely hosted Fresh application? E.g. I'm attempting to do deno run -A https://raw.githubusercontent.com/cknight/dev-tools/main/main.ts but this isn't working as the deno.json file isn't loading and so the import map isn't either. I've also tried using the --config flag, but it only seems to support local files. I'm guessing to support this I would need to rework the application to remove the deno.json file? Use case: I have an application which processes sensitive data. It's best if the use runs this on their own machine, rather than a centrally hosted instance. While the user could clone the repo and run deno task start, a single (albeit, long) command line to run the application locally is attractive.
11 Replies
ioB
ioB16mo ago
Remote config files are an open issue. I'd really love to get that one solved.
Fifth-Normal-Form
I've used a copyable Deno install command in the readme.md, and have the user install from there. At that point the user just runs the command.
ioB
ioB16mo ago
For Pyro I have this install script: https://github.com/lino-levan/pyro/blob/main/install.ts which is definitely a hack This could all be a lot better if --config supported remote configs
Fifth-Normal-Form
In my Hot dev server readme, i have
Usage
To install a local copy, enter:

deno install -n hot -A --unstable https://raw.githubusercontent.com/nhrones/Hot/master/server.ts
Then, in a terminal in the root of your project, just enter hot to run this service.
Usage
To install a local copy, enter:

deno install -n hot -A --unstable https://raw.githubusercontent.com/nhrones/Hot/master/server.ts
Then, in a terminal in the root of your project, just enter hot to run this service.
cknight
cknightOP16mo ago
Sounds like an easy enhancement. I'll have a search for the issue. Thanks!
ioB
ioB16mo ago
GitHub
Support remote configuration files · Issue #13488 · denoland/deno
Especially when using a remote main module, it can be very beneficial to support a remote --config/-c file, especially when you want a one liner without pre-installing anything locally.
ioB
ioB16mo ago
Ha, I said literally the same thing in the issue.
cknight
cknightOP16mo ago
Haha, that's awesome and love the comment 👍 I've not used the install command before. Will it work if the project has a remote deno.jsonfile?
ioB
ioB16mo ago
Ideally --config works with both install and run (they don't work if it's a remote file)
Fifth-Normal-Form
Not sure. I don't use deno.json. Ask Lino. It's a very convenient way to have user install tools/utilities. I've used two installs for utils; one with --reload, and one without, so you can refresh the install if needed.
cknight
cknightOP16mo ago
Yeah, I think we need Lino's awesome hack to make this work with install. Thanks both.