У меня проблема с моим угловым 7 приложением в wampserver
Я сделал это
{
"/api": {
"target": "http://localhost:3000",
"secure": false,
"changeOrigin": true,
"logLevel": "debug"
}
}
"start": "ng serve --proxy-config proxy.conf.json"
мое приложение возвращает это мне
General
Request URL: http://localhost/api
Request Method: GET
Status Code: 404 Not Found
Remote Address: [::1]:80
Referrer Policy: no-referrer-when-downgrade
Response Headers
Connection: Keep-Alive
Content-Length: 286
Content-Type: text/html; charset=iso-8859-1
Date: Thu, 10 Jan 2019 07:08:40 GMT
Keep-Alive: timeout=5, max=99
Server: Apache/2.4.35 (Win32) PHP/7.2.10
Request Headers
Accept: application/json, text/plain, */*
Accept-Encoding: gzip, deflate, br
Accept-Language: es-ES,es;q=0.9
Connection: keep-alive
Host: localhost
Referer: http://localhost/vdfrontend/
Я использовал файл htacces в каталоге проекта, а также изменил файл виртуального хоста
Файл htaccess содержит следующую информацию
<IfModule mod_rewrite.c>
RewriteEngine on
# Don't rewrite files or directories
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
# Rewrite everything else to index.html
# to allow html5 state links
RewriteRule ^ index.html [L]
</IfModule>
файл виртуального хоста содержит следующую информацию
# Virtual Hosts
#
<VirtualHost *:80>
ServerName localhost
ServerAlias localhost
DocumentRoot "${INSTALL_DIR}/www"
<Directory "${INSTALL_DIR}/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName localhost
DocumentRoot "${INSTALL_DIR}/www/vdfrontend"
<Directory "${INSTALL_DIR}/www/vdfrontend">
RewriteEngine on
# Don't rewrite files or directories
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
# Rewrite everything else to index.html
# to allow html5 state links
RewriteRule ^ index.html [L]
</Directory>
</VirtualHost>
мое приложение снова возвращает это мне
General
Request URL: http://localhost/api
Request Method: GET
Status Code: 404 Not Found
Remote Address: [::1]:80
Referrer Policy: no-referrer-when-downgrade
Response Headers
Connection: Keep-Alive
Content-Length: 286
Content-Type: text/html; charset=iso-8859-1
Date: Thu, 10 Jan 2019 07:08:40 GMT
Keep-Alive: timeout=5, max=99
Server: Apache/2.4.35 (Win32) PHP/7.2.10
Request Headers
Accept: application/json, text/plain, */*
Accept-Encoding: gzip, deflate, br
Accept-Language: es-ES,es;q=0.9
Connection: keep-alive
Host: localhost
Referer: http://localhost/vdfrontend/
мое приложение не работает из-за этого, как я могу решить эту проблему?