When using IntelliJ IDEA's debug mode and accessing the corresponding API endpoints via web, breakpoints can be successfully hit. However, when attempting to register an account or access the API endpoints through frontend, a 501 error is returned. The following is the error message from the frontend:
"The frontend encountered an error while registering an account or accessing the API endpoints. The server responded with a 501 error."
node.js:
DB_URL=mongodb://127.0.0.1:27017
HOST=127.0.0.1
PORT=3000
ORIGIN_URL=http://localhost:3000
SECRET=7c1c85586c23e6bef8fe2c3b61fd32ccb4b32d0d4b65e86494f7bccb1bbcc5ba
REGISTRATION_KEY=2c5c2eb5ee92c95cd83f0be8b3dfe6ed43471279948c68ae3adf2adf85336852
MAX_UPLOAD_SIZE=10240
UPLOAD_LOCATION=/home/kali/Desktop/Striker/Striker/backend/static/
SSL_KEY=/home/kali/Desktop/SSL/private.key
SSL_CERT=/home/kali/Desktop/SSL/certificate.crt
web:
VITE_STRIKER_API= 127.0.0.1:3000
└─# python3 -m http.server 8000
Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ...
127.0.0.1 - - [13/Jun/2023 08:04:40] "GET / HTTP/1.1" 304 -
127.0.0.1 - - [13/Jun/2023 08:04:40] "GET /assets/index.ccc63509.js HTTP/1.1" 304 -
127.0.0.1 - - [13/Jun/2023 08:04:40] "GET /assets/index.2499bac9.css HTTP/1.1" 304 -
127.0.0.1 - - [13/Jun/2023 08:05:00] code 501, message Unsupported method ('POST')
127.0.0.1 - - [13/Jun/2023 08:05:00] "POST /127.0.0.1:3000/user/register HTTP/1.1" 501 -
web error info:
JSON.parse: unexpected character at line 1 column 1 of the JSON data