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

Example: symfony app #19

Closed
f3l1x opened this issue Aug 20, 2019 · 11 comments
Closed

Example: symfony app #19

f3l1x opened this issue Aug 20, 2019 · 11 comments

Comments

@f3l1x
Copy link
Collaborator

f3l1x commented Aug 20, 2019

No description provided.

@ties-v
Copy link
Contributor

ties-v commented Aug 29, 2019

What kind of example should this be? The full Symfony demo or some more simple (custom) website using Symfony?

For the full demo website see: https://github.com/ties-v/symfony-demo-on-now and https://symfony-demo.ties.now.sh/

For a little less advanced example I would be able to put something together.

@f3l1x
Copy link
Collaborator Author

f3l1x commented Aug 30, 2019

I think we should have 2 examples

  • tiny minimal example ✅ (thanks @DominikVisek)
  • full standard example

You can start with the minimal. What do you think?

@disjfa
Copy link

disjfa commented Feb 12, 2020

Having issues to build a symfony app. I don't know what to do with cache on a read only file system. And after that i just get weird errors. So i am tagging along on this thread!

@f3l1x
Copy link
Collaborator Author

f3l1x commented Feb 13, 2020

@disjfa
Copy link

disjfa commented Feb 13, 2020

I used the now files from there yes. But i started with a base symfony 5.0 checkout. So i will update when i have tested this one. If i found what and where we can update and upgrade.

@disjfa
Copy link

disjfa commented Feb 13, 2020

Cool, the trick is to fix the cache folder in your local kernel. For reference for people who read this:

public function getCacheDir()
{
    if(isset($_ENV['NOW_REGION'])){
        return '/tmp/symfony/cache/'.$this->environment;
    }

    return parent::getCacheDir();
}

public function getLogDir()
{
    if(isset($_ENV['NOW_REGION'])){
        return '/tmp/symfony/log';
    }

    return parent::getLogDir(); // TODO: Change the autogenerated stub
}

Now the next step is to get the static css/js data from the public/build/ folder on the screen. Can't seem to get that working. Also checked a version 2 of the symfony demo on zeit but still no luck. Tried to fix the routes in the now.json to add something like this.

{
    "src": "/build/app.css",
    "dest": "/public/build/app.css"
},

But no luck, if you have more tips, please. Also when i have something practical i surely will share and blg about it.

@ties-v
Copy link
Contributor

ties-v commented Feb 14, 2020

@disjfa An example for symfony 4.* is available at ties-v/symfony-demo-on-now.

The now.json file might be interesting to you.

One thing to notice is that is not using the new keys like functions and rewrites etc. Maybe I'll update it some time.

Hope it helps!

@disjfa
Copy link

disjfa commented Feb 14, 2020

Yes, thats the v2 version i was talking about. I want to add some npm stuff (encore) also so that breaks there for now.

@ties-v
Copy link
Contributor

ties-v commented Feb 14, 2020

Do you have an example repo somwhere? And what is exactly failing: loading of encore assets?

@disjfa
Copy link

disjfa commented Feb 18, 2020

Pushed my repo, just working on an example to use to prototype. https://github.com/disjfa/symfony-prototype

For now i disabled the encore files and encore build step.

@f3l1x
Copy link
Collaborator Author

f3l1x commented Nov 20, 2020

There are 2 examples of symfony on vercel, take a look https://github.com/juicyfx/vercel-examples.

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

No branches or pull requests

3 participants