Giter VIP home page Giter VIP logo

Comments (11)

ties-v avatar ties-v commented on August 19, 2024 1

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.

from php.

f3l1x avatar f3l1x commented on August 19, 2024

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?

from php.

disjfa avatar disjfa commented on August 19, 2024

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!

from php.

f3l1x avatar f3l1x commented on August 19, 2024

Hey @disjfa.

Do you have problem with this?

https://github.com/juicyfx/now-examples/tree/master/php-framework-symfony-microservice
https://now-examples-php-framework-symfony-microservice.now.sh/

from php.

disjfa avatar disjfa commented on August 19, 2024

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.

from php.

disjfa avatar disjfa commented on August 19, 2024

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.

from php.

ties-v avatar ties-v commented on August 19, 2024

@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!

from php.

disjfa avatar disjfa commented on August 19, 2024

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

from php.

ties-v avatar ties-v commented on August 19, 2024

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

from php.

disjfa avatar disjfa commented on August 19, 2024

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.

from php.

f3l1x avatar f3l1x commented on August 19, 2024

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

from php.

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.