ctx.beginPath();
ctx.moveTo(1, 150);
ctx.lineTo(100, 130);
ctx.lineTo(100, 230);
ctx.closePath();
ctx.stroke();
ctx.fillStyle = 'red';
ctx.fill();
</body>
.Access-Control-Allow-Origin: http://localhost:8080
, то попробуй его добавить в список заголовков в конфиге. Лично мне его хватало с головой. <script type="module" src="main.js"></script>
import { Utils } from "./utils.js";
new Utils().hi();
export class Utils {
hi() {
alert("hi");
}
}
location / {
try_files $uri /index.html;
}
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.html [QSA,L]