1

Well, I've made an node express API, and now I'm trying to deploy it on fly.io. The API deploy is well working, but in same folder of API i got another one with HTML/CSS/js files and I'm trying to deploy it... but that is the problem, I don't know how can I do it.

If I have to use the fly.toml (using volumes) or If I have no make another deploy only for my frontEnd. And there are Dockerfile, another thing that I don't know much.

(I'm Brazilian, If you speak Portuguese would help me a lot and sorry for poor English :P)

I just got passing a html file to mt ' / ' GET method in API deploy... but I think that's is not correct.

 app.get('/', (req,res) => {
 const pokedexhtml = path.join(__dirname, 'src','pokedex_jnx')
 const htmlPath = path.join(pokedexhtml, 'index.html');
 res.sendFile(path.join(htmlPath))
 })

(yes, it is the classic pokedex project {and yes, I've made it without any course tutor})

jnx
  • 11
  • 1
  • app.use(express.static(path.join(__dirname, 'src', 'pokedex_jnx'))); app.get('/', (req, res) => { res.sendFile('index.html'); }); – JIAN SHI Jun 07 '23 at 01:20

0 Answers0