Created
September 11, 2020 15:35
-
-
Save karson/b263abff0ecf4a783b648772eb2c44b7 to your computer and use it in GitHub Desktop.
Servir ficheiros estáticos
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const express = require('express'); | |
| const path = require('path'); | |
| const app = express(); | |
| app.use(express.static(path.join(__dirname, 'build'))); | |
| app.get('/', function(req, res) { | |
| res.sendFile(path.join(__dirname, 'build', 'index.html')); | |
| }); | |
| app.listen(9000); |
Saudações!
Tens boa iniciativa, contudo teste o seu código mas esta retornando erro.
Assim que possível retornarei para testa-lo.
Obrigado pelo feedback, é só tornar um erro para vermos a solução.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Saudações!
Tens boa iniciativa, contudo teste o seu código mas esta retornando erro.
Assim que possível retornarei para testa-lo.