Coder Social home page Coder Social logo

Comments (4)

theofidry avatar theofidry commented on May 22, 2024

It's still useful since the front controller is in web. Besides if you're shipping an SPA with it, you may as well put all your front-end files in web instead of having two separate repository. If you don't need it it can always delete it :)

from api-platform.

dunglas avatar dunglas commented on May 22, 2024

Hi,

This is a rest of the the Symfony standard edition.

The web folder is necessary for storing front controllers.
We can discuss about removing robots.txt and favicon.ico (this one must at least be replaced with the API Platform logo) but as crawlers will always request them, your logs will be full of 404 if they aren't present. It's considered best practice to always have those files.

Solution proposed by @theofidry can be useful for prototype and small apps but the recommended way of using API Platform is having separate git repositories (and servers) for the API and the frontend app.

from api-platform.

sadovnik avatar sadovnik commented on May 22, 2024

@dunglas 404 logging of these files can be easily prevented by your web server:

location ~* \/(favicon\.ico|robots\.txt) {
    log_not_found off;
    access_log off;
}

They don't make a problem.

What's the purpose of requesting these files in terms of an API? I haven't found any references about this topic, could you please share some?

from api-platform.

theofidry avatar theofidry commented on May 22, 2024

@codeskull they both don't have any use for the API. As @dunglas said crawlers will always request them, and even if you can disable logging for these files, it is not done by default. That's way it is considered good practice to keep them, at least for "distributed products". If you have your API installed, there is nothing preventing you to remove them and disable the logging for that.

from api-platform.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.