Phatso
Phatso
Explore posts from servers
DDeno
Created by Phatso on 5/10/2024 in #help
Websockets API with async processing (is there a better way?)
In my tests, I was just getting data - the db could still be holding things up though I guess
12 replies
DDeno
Created by Phatso on 5/10/2024 in #help
Websockets API with async processing (is there a better way?)
The websocket layer is receiving the message, deserializing it, and then sending it over to the Worker. Is that better or worse than sending the string?
12 replies
DDeno
Created by Phatso on 5/10/2024 in #help
Websockets API with async processing (is there a better way?)
Thanks!
12 replies
DDeno
Created by Phatso on 12/6/2022 in #help
Import from variable path?
Amazing, thank you! Unfortunately Cloudflare doesn't like it (top-level imports) But I was able to rework my setup. My new structure is like:
myProject/
- index.js
- setup_app.js
- docker/
- selfhost.js
myProject/
- index.js
- setup_app.js
- docker/
- selfhost.js
// index.js
import { app, serve } from "./setup_app.js"
// index.js
import { app, serve } from "./setup_app.js"
And then in my Dockerfile
...
COPY ./index.js /app/index.js
COPY ./docker/selfhost.js /app/setup_app.js
...
COPY ./index.js /app/index.js
COPY ./docker/selfhost.js /app/setup_app.js
So basically I just make the files behave the same way, but stub the setup_app.js with my selfhost.js in the container itself. I imagine there's a more elegant way to do this with esbuild or something but I'm just relieved to be done with it 😅
3 replies