-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
15 additions
and
7 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,3 +43,5 @@ testem.log | |
# System Files | ||
.DS_Store | ||
Thumbs.db | ||
|
||
dist/ |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,18 @@ | ||
const express = require('express'); | ||
const path = require('path'); | ||
|
||
const express = require("express"); | ||
const router = express.Router(); | ||
const path = require("path"); | ||
const app = express(); | ||
|
||
app.use(express.static('./dist/desafio-accenture-svl')); | ||
const port = process.env.PORT || 8080; | ||
|
||
app.use(express.static("./dist/desafio-accenture-svl")); | ||
|
||
app.use(express.json()); | ||
app.use("/", router); | ||
|
||
app.get('/*', (req, res) => | ||
res.sendFile('index.html', {root: 'dist/desafio-accenture-svl/'}), | ||
app.use(express.static(path.join(__dirname, "/dist/desafio-accenture-svl"))); | ||
app.get("*", (req, res) => | ||
res.sendFile(path.join(__dirname, "/dist/desafio-accenture-svl/index.html")) | ||
); | ||
|
||
app.listen(process.env.PORT || 8080); | ||
app.listen(port, () => console.log("Server Running")); |