I'm trying to run the following example: https://github.com/ceolter/ag-grid-react-example
(ag-grid react example)
But, instead of doing npm run
I want to run it on tomcat. How to do it?
You can easily deploy any static files on Tomcat. The project you linked does not have a script to build production version of the sample, so what you need to do is:
npm install -g webpack
webpack --config webpack.config.standard.js --progress --colors --hot --inline
or webpack --config webpack.config.large.js --progress --colors --hot --inline
. It will create dist
directory.webapps
directory create create another directory for your demo ag-grid
.index.html
and dist
to ag-grid
.http://host:port/ag-grid
.Execute
npm run build
This will create the deployable version of your app in the build
subfolder inside your project tree. All you need now is to copy the index.html
with its all friends from this folder into your Tomcat directory intended to serve static files. This is the top level in the Tomcat application folder. The standard directory layout documented here.
It is also very simple build a real web application (.war) as described here. Static files just reside on the top level of the archive, you should also configure default pages in WEB-INF/web.xml inside the archive. Such app can be deployed from Tomcat administration console.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With