R
Railwayβ€’8mo 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β€’8mo ago
Project ID: 1aa4380a-1423-4392-a56a-2d49595fe43e
Brody
Brodyβ€’8mo 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
Remβ€’8mo ago
idk why, but registerFont() crased before.. now it's working, thanks! πŸ˜„
Brody
Brodyβ€’8mo ago
awsome!
Rem
Remβ€’8mo ago
quick other question >
Brody
Brodyβ€’8mo ago
sure!
Rem
Remβ€’8mo 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β€’8mo ago
can you provide some context for this question?
Rem
Remβ€’8mo 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β€’8mo ago
what do you mean by proxy deployment?
Rem
Remβ€’8mo 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β€’8mo ago
it just redirects? thats all it does?
Rem
Remβ€’8mo 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β€’8mo ago
then you have two options, add the domains since there is no limit, or use host masking
Rem
Remβ€’8mo ago
host masking isn't an option because some things in react depend on the host πŸ˜„
Brody
Brodyβ€’8mo 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
Remβ€’8mo ago
yeah so i'd either need to request a dedicated IP or use another service for this part
Brody
Brodyβ€’8mo ago
railway does not have dedicated ips
Rem
Remβ€’8mo ago
then there's only 1 option left 😦
Brody
Brodyβ€’8mo ago
can you tell me why you have 100 domains?
Rem
Remβ€’8mo 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β€’8mo ago
if you dont mind me asking, a few thousand domains for what?
Rem
Remβ€’8mo ago
they're not my domains πŸ˜„
Brody
Brodyβ€’8mo ago
clients domains?
Rem
Remβ€’8mo ago
yes
Brody
Brodyβ€’8mo ago
are you on the pro plan?
Rem
Remβ€’8mo ago
not yet but it depends a bit, i am exploring railway
Brody
Brodyβ€’8mo ago
okay cool, was just about to say a project with a few thousand clients isnt a hobby use case lol
Rem
Remβ€’8mo ago
running a staging and "prod" which is essentially both staging πŸ˜„
Brody
Brodyβ€’8mo ago
you could run your own edge router as a cloudflare worker?
Rem
Remβ€’8mo ago
would have to look into that, but sounds like overcomplicating stuff
Brody
Brodyβ€’8mo ago
true