R
Railwayβ€’14mo ago
Rem

Custom Font Node app

Hi! I need to use a font in my node app (for canvas). I have the TTF but I can't use it. How can i do this?
32 Replies
Percy
Percyβ€’14mo ago
Project ID: 1aa4380a-1423-4392-a56a-2d49595fe43e
Brody
Brodyβ€’14mo ago
have a look at this example project https://github.com/brody192/node-canvas-fonts I don't know what exactly your project needs to get and and running but start by copying over the railway.json file from my repo to yours, then let me know if you are able to use fonts
Rem
RemOPβ€’14mo ago
idk why, but registerFont() crased before.. now it's working, thanks! πŸ˜„
Brody
Brodyβ€’14mo ago
awsome!
Rem
RemOPβ€’14mo ago
quick other question >
Brody
Brodyβ€’14mo ago
sure!
Rem
RemOPβ€’14mo ago
If I want to proxy other domains to a railway deployment, it's not gonna work unless I manually assign the domain to the deployment right?
Brody
Brodyβ€’14mo ago
can you provide some context for this question?
Rem
RemOPβ€’14mo ago
Yeah so my proxy deployment on railway has abc.com assigned (example) on def.com I add a CNAME to abc.com Then I get a railway page saying nothing's here
Brody
Brodyβ€’14mo ago
what do you mean by proxy deployment?
Rem
RemOPβ€’14mo ago
I run a proxy service on railway that redirects to my react pod abc.com goes to that proxy, and that forwards it to my react
Brody
Brodyβ€’14mo ago
it just redirects? thats all it does?
Rem
RemOPβ€’14mo ago
basically the point is that I don't wanna assign 100 domain names in railway, but just add a cname to those domains
Brody
Brodyβ€’14mo ago
then you have two options, add the domains since there is no limit, or use host masking
Rem
RemOPβ€’14mo ago
host masking isn't an option because some things in react depend on the host πŸ˜„
Brody
Brodyβ€’14mo ago
railways router uses the host to route the incoming traffic to your app, but if you try to access your app from a host that isnt a part of the service then railway will just return 404
Rem
RemOPβ€’14mo ago
yeah so i'd either need to request a dedicated IP or use another service for this part
Brody
Brodyβ€’14mo ago
railway does not have dedicated ips
Rem
RemOPβ€’14mo ago
then there's only 1 option left 😦
Brody
Brodyβ€’14mo ago
can you tell me why you have 100 domains?
Rem
RemOPβ€’14mo ago
well probably a few thousand but i want to offer a white label feature for my application where people assign their own domain
Brody
Brodyβ€’14mo ago
if you dont mind me asking, a few thousand domains for what?
Rem
RemOPβ€’14mo ago
they're not my domains πŸ˜„
Brody
Brodyβ€’14mo ago
clients domains?
Rem
RemOPβ€’14mo ago
yes
Brody
Brodyβ€’14mo ago
are you on the pro plan?
Rem
RemOPβ€’14mo ago
not yet but it depends a bit, i am exploring railway
Brody
Brodyβ€’14mo ago
okay cool, was just about to say a project with a few thousand clients isnt a hobby use case lol
Rem
RemOPβ€’14mo ago
running a staging and "prod" which is essentially both staging πŸ˜„
Brody
Brodyβ€’14mo ago
you could run your own edge router as a cloudflare worker?
Rem
RemOPβ€’14mo ago
would have to look into that, but sounds like overcomplicating stuff
Brody
Brodyβ€’14mo ago
true
Want results from more Discord servers?
Add your server