Skip to content

Commit

Permalink
Solución para static build
Browse files Browse the repository at this point in the history
  • Loading branch information
tsmanuelanton committed Apr 28, 2022
1 parent c3cd9a7 commit 79a6d84
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion webapp/server.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
import express,{Application} from 'express';
import path from 'path';
//for using an import here we need to configure the tsconfig.json
//setting the option module to commonjs

var app: Application = express()
const port: number = 3000;

app.use(express.static('build'))
app.use(express.static(path.join(__dirname, 'build')));

app.get('/*', function (req, res) {
res.sendFile(path.join(__dirname, 'build', 'index.html'));
});

app.listen(port, ():void => {
console.log('Webapp started on port '+ port);
Expand Down

0 comments on commit 79a6d84

Please sign in to comment.