How to Deploy Api with Composer / Slimframework

Asked

Viewed 95 times

0

I have an api working on localhost how do I send it to my ftp? I have these folders, downloaded with Composer slimframwork just send everything? inserir a descrição da imagem aqui

1 answer

1


The way you organized the folders and the index.php, yes just send the contents of the folder Backend via FTP to the "root" folder of the HTTP server.

On SHARED servers and VPS is usually the folder public_html, sometimes htdocs or www

No need to send folder git (and nor should), also note that maybe the folder vendor and the folder class would be better off outside the public_html (or similar), because eventually depending on what is placed on them there is a remote possibility that something can be executed when it should not, which can cause problems, such as bugs or possibly even some security flaw.


However if you had installed via Skeleton via the command line with composer, for example:

composer create-project slim/slim-skeleton [pasta-projeto]

The root folder would be the public, then the scheme to be used would be more or less this:

/home/user/
   |--- /vendor
   |--- /class
   +--- /public_html     (pasta padrão em servidores com cpanel)
          |--- index.php (arquivo da pasta [pasta-projeto]/public)
          +--- .htaccess (arquivo da pasta [pasta-projeto]/public)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.