PHP Developer with Twig knowledge can start expressjs project with twig in few moment

Om Prakash Tiwari - Aug 1 '22 - - Dev Community

The Background

As a PHP Developer I was used to work with twig template engine like most of the PHP Developers. I found the twig engine is supported by express js as well and also my teammates were using this extensively. I have decied to use the same template engine for my projects.

Starting the first project

If you are from PHP Background and using twig template engine, and want to switch to express js, then you can follow the below steps to download the boilerplate code for express and setup your project automatically.

  1. Install nodejs (Latest version) from https://nodejs.org/en/download/ (the official website)

  2. Open Command prompt (Windows) or Terminal (Mac/Linux) and run the following command:

    npx start-express [project-name]

    -- [project-name] is the name of your project.
    
  3. This will generate a directory with your project name and add essentials into it.

  4. Open the directory in your text editor.

  5. Run the following command to start the server in development mode:

    npm run devstart

  6. You can now access your project in your browser on port 3000.

A readme file is also generated for more information. You can go through it for more details.

. .
Terabox Video Player