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.
Install nodejs (Latest version) from https://nodejs.org/en/download/ (the official website)
-
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.
This will generate a directory with your project name and add essentials into it.
Open the directory in your text editor.
-
Run the following command to start the server in development mode:
npm run devstart
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.
Top comments (0)