I'm working on a Symfony Project. I had to install the API PLATFORM. So I did a
composer require api
Then when I want to access my /api with localhost:8000/api, it shows me this code
{"resourceNameCollection":["App\\Entity\\User"]}
with a white page, nothing more.
My question is why is it not showing this instead ?
My routes/api_platform.yaml
api_platform:
resource: .
type: api_platform
prefix: /api
My packages/api_platform.yaml
api_platform:
title: 'Symfony REST API'
description: 'A Symfony API.'
version: '1.0.0'
mapping:
paths: ['%kernel.project_dir%/src/Entity']
swagger:
versions: [3]
patch_formats:
json: ['application/json']
eager_loading:
force_eager: false
formats:
json:
mime_types: ['application/json']
multipart:
mime_types: ['multipart/form-data']
collection:
pagination:
enabled: false
My security.yaml
security:
encoders:
App\Entity\User:
algorithm: bcrypt
providers:
users_in_memory: { memory: null }
users_in_database:
entity:
class: 'App\Entity\User'
property: "username"
firewalls:
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
main:
anonymous: true
provider: users_in_database
form_login:
login_path: security_login
check_path: security_login
logout:
path: security_logout
target: home
access_control:
I found the problem.
In my 'packages/api_platform.yaml', I added
html:
mime_types: ['text/html']
In the formats like this
formats:
json:
mime_types: ['application/json']
jsonld:
mime_types: ['application/ld+json']
html:
mime_types: ['text/html']
multipart:
mime_types: ['multipart/form-data']
So basically it needed the html format to render the page, I guess.
Firebase Cloud Functions: PubSub, "res.on is not a function"
TypeError: Cannot read properties of undefined (reading 'createMessageComponentCollector')
I am trying to display two outputs in different functions into single innerHTML when the button clickedHowever, I want it without using a global variable to store the output
Here's a quick rundown of the relevant code before I ask this question
So, I have this inertiaJS & VueJS app am creating, the backend is in LaravelAt the start, the app is working fine, but once you navigate to another page say log in, Jquery just fails without any error message and everything becomes deformed, even when I navigate...