Требовать JS не удается загрузить основные данные - PullRequest
0 голосов
/ 19 июня 2020

Я пытаюсь инициализировать RequireJS в своем проекте веб-приложения.

Структура проекта:

index.html
assets/
  common.js
  lib/
    require.js
scripts/
  main.js

Содержимое индекса. html файл:

<html>
<head>
  <title> Title </title>
</head>
<body>
  <script data-main="assets/common" src="assets/lib/require.js"></script>
  <script>
  require(['common'], function() {
    require(['scripts/main']);
  });
  </script>

  <p> some Text
</body>
</html>

Веб-приложение не может найти файл common. js на сервере. Я просто получаю ошибку 404 с сервера.

<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL was not found on this server.</p>
<hr>
<address>Apache/2.4.29 (Ubuntu) Server at myServer.de Port 443</address>
</body></html>
...