Add camunda webapps to (micronaut) project with embedded engine - angularjs

The goal
I have a micronaut project with an embedded camunda process engine (micronaut-camunda-bpm) and I am trying to integrate the camunda webapps in the same manner as the "spring-boot-starter" for camunda.
So what I am basically trying to do is to integrate the camunda webapps into my own application.
What I have done so far
(According to camunda best practices embedding the webapps into your own app is not easy and there is no documentation for it.. ).
So far I added the org.camunda.bpm.webapp:camunda-webapp-webjar and tried to serve the webapps by pointing the hosting of static resources to the webjar that includes all js/html/css files. I am facing the problem that the angularjs webapps require resources through relative links starting with "$APP_ROOT" which do not get resolved properly.
E.g. stylesheets should get loaded but instead of loading them from /app/welcome/styles/styles.css the angularjs app tries to load them from /app/welcome/$APP_ROOT/app/welcome/styles/styles.css which logically results in HTTP StatusCode 404. I cannot change the links in the HTML since they are included with a dependency.
The questions
Is there a proper way in micronaut how I can resolve the $APP_ROOT properly?
Maybe with some kind of redirect or Filters?
Is this even the right way to integrate the camunda webapps in my own app?
Any help is higly appreciated!

Related

Hosting an existing Angular website

I am working on a website for a family friend. It's a fairly simple Angular SPA with 3 'pages'. When I'm done, I plan to bundle it into an html, css, and js file. In addition, I own the domain that I'd like to use through google domains.
Currently, I am trying to find a hosting service that will let me upload my 3 files (html, js, & css) and just host it. However, I haven't found any services that let me do that other than AWS. So far, I've tried weebly and squarespace and they make me use their templates and GUI to build the website. If I needed, I could just use their templates. However, I'd prefer to bbuild it from scratch so I can practice my Angular and Node Skills.
Any suggestions for website hosting services that let me upload the html, css, and js files of a website I've already built?
Thank you.
You can do so with any website that supports FTP. If you are looking for something really simple, see:
https://www.bluehost.com/
Amazon, recently launched a service just for this purpose. See:
https://amazonlightsail.com/
Best place to do it : https://pages.github.com/
You can link your domain to gihtub's IP.
If you feel gh-pages are tought. Try others like https://www.hostinger.in/, https://www.hostinger.com/ , https://in.000webhost.com/

What files do I need to host an angularJS website

I'm trying to host my first website. I've made it using angularjs, bootstrap and yeoman as a generator. However when I tried to upload it, I realized that the full size of everything in my folder (including the generated stuff by yeoman) was nearly 100mb.
What files do I actually need to host? Node is nearly 60mb and grunt isn't much smaller. Any advice would be greatly appreciated.
Assuming you have a web server like nginx or apache already on that server, you just need to upload the dist folder that is created when you run grunt build.
You don't need all that generator and node stuff just to host a simple test project.
What you actually need is a single HTML file, called index.html. Include Angular and bootstrap (you can omit this, too, if you can go without fancy styles) and create a file app.js which will hold your application logic.
http://angularjs.org shows this in a neat way on their landing page, just scroll down to 'The basics'
As static angularjs application will contain mainly HTML, CSS and JS files you can host your project on simple apache webserver. (Apache - http://httpd.apache.org/)
If you are making a dynamic angularjs application you will have webservices returning you JSON data. If you implement the restful webservices in Java (using Jersey) you can deploy you entire angularjs application with java webserivce implementation to tomcat web server. (Tomcat - http://tomcat.apache.org/)
Hope this helps!
Decided to answer this old question because its one of the few that show on google when searched.
You do not need to use Grunt anymore, I do not know if this was needed at the time of this question.
instead just do
ng build my-app
this would have saved me some hours.
link to current doc

Fast way to develop AngularJS in a Java environment

I am currently working on a Java based Maven project that has a REST backend module and using angular JS as a frontend that uses the backend for data. The 2 modules are named "rest" and "web" accordingly and are deployed as 2 separate war files to a glassfish instance during development. The glassfish is on a different machine.
My problem is that this is kind of slow, especially when developing the angular based frontend. Fix a minor spelling mistake, package, redeploy. Not that slow but every character change or fiddling with angular is another 20-30 seconds lost.
One thing I tried is to directly load the files from the source directory into the browser with file:// tag. This is OK as long as it tries to call the REST backend which fails due to CORS (I don't remember the exact error message, it just doesn't work). This happens a lot so it's a no-go.
I'm open to every kind of solution to develop angular in a way that I could see my changes instantly instead of deploying it every time? Much like the guy does in the egghead videos.
I would recommend breaking your Angular JS application into its own separate project, this would be a new HTML5 project on Netbeans. That way you can focus on pure backend and frontend development in their respective projects and you do not have to manually separate the war files. This link will help you to get CORS working if you are defining your RESTFUL services with Jersey Access-Control-Allow-Origin in ajax call to jersey rest web services. Or you can just mock the data out in the front end project.

Upload files to Angular or Rails

I´m trying to integrate a Blueimp Jquery File Upload plugin in my application.
My application has an AngularJS front-end running in a Node.js server and a Rails API backend running in a WEBrick server.
I would like to clarify which is the best practices to store the files? In Angular (this case Node.js) server or the Rails one.
Thanks,
Roberto.
I'm working on an app that has the exact same layout as yours and I came to the same question.
Since I'm trying to separate the back-end and front-end completely and have all the work with the db and files done in the back-end, I found that it's better to save the files in Rails server. That also gives you an option to do background operations with files (using sidekiq, for example), without making users wait for completion in the front-end.
There are lots of tools for file upload from angularJS to the server (Rails), but I personally found angular-file-upload directive easiest to understand and implement. I recommend you check it out.
I hope it helps,
Ulugbek

How are people using Yeoman?

I've been playing around with Yeoman and it's pretty great.
I'm wondering how people are integrating the resulting frontend app with backends?
Are you keeping them as separate code bases that potentially run on separate servers?
Are you stuffing the whole directory in a rails public folder and pointing the root route at index.html buried in there?
Up until now I've only ever used helpful gems to integrate backbone or ember into the rails asset pipeline. I could certainly move various files into the assets directory of a rails app but that kinda defeats the purpose of Yeoman.
So far I only used it to make and maintain the frontend app, using ajax to get all the information needed from the backend deployed as another project (web service).

Resources