Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Test Error: "The requested Resource was not found." #727

Closed
Xjodia opened this issue Dec 11, 2023 · 5 comments
Closed

API Test Error: "The requested Resource was not found." #727

Xjodia opened this issue Dec 11, 2023 · 5 comments

Comments

@Xjodia
Copy link

Xjodia commented Dec 11, 2023

Apiato Version

11.x

PHP Version

8.2.13

Database Driver & Version

MySQL 8.2

Description

Hello everyone, I'm new to Apiato.
I have installed everything the docs instructed, but when I test the API with Postman, it always returns the error "The requested Resource was not found."
I have ran cmd php artisan route:list --path=categories and it returned:

  POST       api.apiato.test/v1/categories ................... App\Containers\AppSection\Category\UI\API\Controllers\Controller@createCategory
  GET|HEAD   api.apiato.test/v1/categories ................. App\Containers\AppSection\Category\UI\API\Controllers\Controller@getAllCategories
  DELETE     api.apiato.test/v1/categories/{id} .............. App\Containers\AppSection\Category\UI\API\Controllers\Controller@deleteCategory
  GET|HEAD   api.apiato.test/v1/categories/{id} ............ App\Containers\AppSection\Category\UI\API\Controllers\Controller@findCategoryById
  PATCH      api.apiato.test/v1/categories/{id} .............. App\Containers\AppSection\Category\UI\API\Controllers\Controller@updateCategory

When i tried http://127.0.0.1:8000/api.apiato.test/v1/categories or http://api.apiato.test/v1/categories, it only return "message": "The requested Resource was not found.",

Here is my .env config

APP_NAME="apiato"
APP_ENV=local
APP_KEY=base64:AzI3e1aFiv15K7vjvAc1hfPAKNW9DJG27NR6bKMEZgs=
APP_URL=http://apiato.test
API_URL=http://api.apiato.test
API_PREFIX=/

Steps To Reproduce

Screenshot from 2023-12-11 14-27-34

@yalsicor
Copy link
Contributor

Is your db setup correctly?

@Xjodia
Copy link
Author

Xjodia commented Dec 12, 2023

Is your db setup correctly?

yes, i have setup mydb setup correctly. Btw I have a question, is' it true to run php artisan serve to start up Apiato?

@yalsicor
Copy link
Contributor

I have never used that, so I dont know. Maybe the API routing would not work with this, since its reliant on subdomain configuration.
What flavour are you running? Plain, Docker, WAMP? I would debug if your routes are even reached, and if so get the raw exception and see whats going on.

@yalsicor
Copy link
Contributor

If you are not running a proper webserver locally, http://api.apiato.test:8000/v1/categories would only work if you point the domain to 127.0.0.1, on Linux this would be in the /etc/hosts file.

@Xjodia
Copy link
Author

Xjodia commented Dec 13, 2023

If you are not running a proper webserver locally, http://api.apiato.test:8000/v1/categories would only work if you point the domain to 127.0.0.1, on Linux this would be in the /etc/hosts file.

Bro you save me!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants