#Live App https://draftjs-examples.herokuapp.com/
#Running On Heroku
You can create your own version of the app (including MongoDB!)
#Local Installation
- Install Node.js
git clone https://github.com/rajaraodv/draftjs-examples.git
cd draftjs-examples
npm install
#Running Locally You need two terminal windows open, one for client and the other for server.
####Development
- run
npm start
. This runs the app server (Express). - In terminal 2, run:
npm run dev
. This runs the development server(webpack-dev-server). - Open browser and go to:
localhost:8080
#####Note: If you open localhost:3000
in browser, you'll see a "stale" production app, so while in development, always go to localhost:8080
####Production
In production, we need to compile the latest client js and place it to public
folder. This allows the main app server(Express) to also show the final app.
- Generate latest React app:
npm run build
. - In terminal 1, run
npm start
. It will be running both the server and the client. - Open browser and go to :
localhost:3000
.
#Manually Pushing To Heroku Running your own instance on Heroku.
git clone https://github.com/rajaraodv/react-redux-blog.git
cd react-redux-blog
heroku login
(enter heroku credentials)heroku init
heroku create
git push heroku master
###Making changes to your app and pushing it to Heroku Everytime you make changes to the front end, you need to build it, and do git commit before pushing it to Heroku test server.
npm run build
#build new React app JSgit add .
#Add change to gitgit commit -m "<your comment>"
git push heroku master
heroku open
I usually have something like below that combines all the steps. I just change the commit message everytime.
npm run build && git add . && git commit -m "made changes" && git push heroku master && heroku open
- Create your Editor component in
/public/src/components
folder - Add the component to
/public/src/pages/Examples
- If you need to add any stylesheets, add it to
/public/style
- Make sure to use classnames that are unique so it doesn't conflict w/ other examples.
#LICENSE MIT