2

i want to start new react project using great create-react-app tool, but i need to serve app using php to allow me to fetch some dynamic data and configuration and feed it to react before it starts.

how can i config create-react-app to server php ?

php have its own builtin server, so may be we can use it to launch index.php

php -S localhost:8000 ./public/index.php

is there a way to let webpack launch php built-in server and still have all live reload and features that comes with react-create-app ?

1 Answer 1

1

Use below code:

  1. Open your application folder in command line.
  2. Write below code with your react config file. (E.g: development.config.js)

Code

webpack-dev-server --progress --inline --hot --port 8080 --config reactconfig/development.config.js

OR

npm start
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.