Has anyone had an issues with .well-known/ files not showing up properly in their railway builds?
cmaccarone
PROOP

a year ago

my env: vite react web app.

vite config:

import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'

// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
build: {
sourcemap: true,
outDir: 'build',
},
publicDir: 'public',
})

I am trying to setup our web app to verify apple universal links for our mobile apps. But it's not working. when I test locally running vite build and then vite preview it shows the config file fine, but after running my build in railway the deployed version of the app shows a 404 page when I try visiting the path. The file is .well-known/apple-app-site-association which apple requires not to have a .json file name. This is a commonly needed feature. I would appreciate any feedback if anyone has had any experience configuring .well-known files with railway before. I can't give access to the repo but I can spin up a example one if need be to demonstrate the issue.

original issue:

https://help.railway.app/questions/vite-public-well-known-folder-not-avail-a7ea8a05

0 Replies

cmaccarone
PROOP

a year ago

aa5f6f94-b4b8-4582-bfda-61de1da9b940


brody
EMPLOYEE

a year ago

use the Caddyfile and nixpacks.toml from this repo in yours


cmaccarone
PROOP

a year ago

I will check it out


cmaccarone
PROOP

a year ago

thank you


cmaccarone
PROOP

a year ago

That worked Thanks!!


cmaccarone
PROOP

a year ago

@Brody


brody
EMPLOYEE

a year ago

awsome


cmaccarone
PROOP

a year ago

summary (my hypothesis of why it worked, still a little unfamiliar with these technologies), using caddy with nixpacks gives more control over the build process than using the lighter weight npm serve package I was using


brody
EMPLOYEE

a year ago

caddy doesn't have anything to do with the build process, it's just serving the built files


brody
EMPLOYEE

a year ago

serve is also not lightweight in terms of memory compared to caddy


cmaccarone
PROOP

a year ago

thanks for the correction


cmaccarone
PROOP

a year ago

wanting to learn what made this work.


cmaccarone
PROOP

a year ago

still not sure why vite wasn't working


brody
EMPLOYEE

a year ago

you used serve instead of a proper web server, now you are using caddy


cmaccarone
PROOP

a year ago

can you reopen the original ticket I will post the solution there. and modify my comments


cmaccarone
PROOP

a year ago

i didn't see any other tickets regarding .well-known


Loading...