Skip to content

Commit

Permalink
fix path config
Browse files Browse the repository at this point in the history
  • Loading branch information
jhornsten committed Oct 13, 2023
1 parent 8b2e500 commit 2d88bc2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
<head>
<meta charset="utf-8" />
<title>Alla mot alla generator</title>
<link rel="stylesheet" href="/static/style.css" />
<link rel="stylesheet" href="public/static/style.css" />
</head>

<body>
<div class="page">
<input type="text" name="text" id="text" placeholder="Enter text..." />
<canvas id="amaBoard" width="1200" height="675"></canvas>
</div>
<script src="image.js"></script>
<script src="public/image.js"></script>
</body>

</html>
4 changes: 2 additions & 2 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ const app: Express = express();
const port = process.env.PORT || 8080;
const path = require('path');

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

app.get('/', (req: Request, res: Response) => {
res.sendFile(path.join(__dirname, '/index.html'));
Expand Down
2 changes: 1 addition & 1 deletion public/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ function generateImage(text) {
gradient.addColorStop(1, "#bab466");
offscreenCtx1.fillStyle = gradient;

imageObj.src = "canvas.jpg";
imageObj.src = "/public/canvas.jpg";
imageObj.onload = function () {
ctx.drawImage(imageObj, 0, 0);

Expand Down

0 comments on commit 2d88bc2

Please sign in to comment.