I'm trying to deploy my angular application to IIS in windows server. I'm currently using grunt to build the app and then have a web.config to point to my index.html in the dist folder.
The problem is that is not finding any vendor.css or main.css, nor any vendor.js or scripts.js files. I'm not sure if there are tags I can include to my web.config so that it knows where to look for these files. Also, I copied all folders within the dist and pasted the into the root directory of the application and it seemed to work, but then it could not find components I'm currently using in the app.
This how my website looks with current setup:
ISS Website
If anyone can help me solve this I would greatly appreciate it. Thanks in advance!
Related
This is the application folder structure and I have specified the paths as well as and tried several ways to run but I have an error like . Can Anyone give the right solution to start the angular folder.
Whole application structure:
Error while start the angular.js app:
package.json:
it's Angular.js project, not Angular. so ng comang will not work
look inside gulpfile.js for command to start your app
or run in project's root folder gulp --tasks
I know there are many articles on google about this but in some cases they are keeping react(frontend) + springboot(backend) together in a single war, but my requirement is different I want to keep the both wars as separate.
So what I tried till now,
Directly adding the react build folder in jboss->standalone->deployment but it does not work, it works on tomcat but not on jboss
Then I created a new dynamic web maven project and renamed react build folder and added it to maven project webapps directory and created a war, but after deployment its giving 403 error, and I am not getting why.
Here is a snapshot of my folder structure, pom file and error on browser
Please help regarding this have been stuck at it for days now with jboss
Is there any other way to do it, I will be happy to change my approach.
tried this also, did not worked
https://www.megadix.it/blog/create-react-app-servlet/
spring boot comes with default tomcat, you can exclude from the dependency
https://spring.io/blog/2014/03/07/deploying-spring-boot-applications
https://dev.to/jakmar17/deploy-spring-boot-on-wildfly-application-server-2029
I have the same problem and I haven't found a good solution. The best I found is to create a dynamic web project in eclipse. Copy the build files into webContent and use HashRouter instead of BrowserRouter with basename equal to the project name. Finally compile and generate the war. I hope the advice helps you.
I am wondering if it is possible to deploy react.js web app that I've built to a share hosting site that does not have node.js installed?
I use webpack to build the application and it creates normal html, js, css file. I uploaded the static folder that includes all those html, js(bundle.js) and css files, but when I request the site, the server reply with 404 bundle.js not found response.
Use npm run build, you should get a folder with the index html file inside that will run your app. Try this with xampp first before you actually deploy to your server.
Here is everything step by step
npm run build
or
yarn run build
it will generate a build folder that looks like this:
Copy everything and move it to the htdocs in xampp or ftp upload the directory to the public_html file in your hosting
Yes you sure can put react on a shared hosting provider.
Seeing as you're getting a 404 error (not found), you are probably referencing your react file/bundle incorrectly. It might not even be named bundle.js if you're using a boilerplate to create your application.
Can you give more information? What does your index.html file look like? What does your directory structure look like? If you are able to post these files I can tell you what the issue is.
Update:
The answer below should be accepted. (Although this would assume that you have the ability to make a build which you have not verified or not.)
Make a build using the build command through whatever boilerplate you used. Deploy those files on your shared hosting server. Make sure that index.html is at the root of where your server is expecting the root to be and your app should be live.
For deploying a react app on a shared hosting you need to create a production build. Production build is a pack of all your react code and its dependencies.
in most shared hosting we put our site/app inside a public_html directory so if we hit www.yourdomain.com it serves the code from public_html directory.
so if your react app is ready to go, edit your package.json file add a new key value:
"homepage":"http://yourdomain.com"
then create a build using following command:
npm run build
after running the command you will see a new directory named build in your app root. It will contain js and css for the app and a index.html file. You need to upload all the content inside build directory to public_html directory, and that's all, go to your domain and your app will be working just fine.
I built my polymer project and deployed it with the firebase command. I followed the instruction on the polymer site. In Chrome on my Mac it works, but on my mobile(Chrome and Safari) and Safari on my Mac it display an empty page.
Can anybody help me out?
best regards
UPDATE: the dependency problem has been fixed with v0.16.0 which deployed this evening 8/24/2016. I have kept the below workaround just for reference.
This is a known issue: https://github.com/Polymer/polymer-cli/issues/347
includeDependencies stipulated in polymer.json is not being processed.
Here's the remedy for now:
The 'polymer build' process is not including the polyfill in the build even when you include it in the polymer.json dependencies.
This polyfill is necessary for browsers which do not support web components.
Therefore until it is fixed it needs to be added manually...
After running 'polymer build':
open the app's bower_components folder
copy the webcomponentsjs folder
open the build folder
paste the webcomponentsjs folder in the bundled/bower_components and unbundled/bower_components
run firebase deploy
(Do this for all dependencies you require.)
I'm using Angular 1.4.6 and I cannot see services directory in app structure. If I added myself it, I cannot see in project source this time.
After add services directory in app structure, build / serve by Grunt but the result did not change.
Whats the problem? How can I fix it?
Thanks.