Skip to content

Commit

Permalink
Changes to upload onRender
Browse files Browse the repository at this point in the history
  • Loading branch information
Sevalas committed Mar 20, 2023
1 parent 08f733b commit 9f41d8d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,5 @@ testem.log
# System Files
.DS_Store
Thumbs.db

dist/
20 changes: 13 additions & 7 deletions server.js
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"));

0 comments on commit 9f41d8d

Please sign in to comment.