Can I download A-frame library offline and host on my server? - offline

As A-frame is a opensource framework, is it possible to download the A-Frame libraries offline and setup in own server?

Yes, the JS files can be downloaded: https://github.com/aframevr/aframe/tree/master/dist
The instructions there explain which to file use; you probably only need one of those files. The copies of the library hosted on a CDN are just there as a convenience, downloading the file is perfectly fine.

Related

Serving an Angular2 App on aws s3

I have created a Angular 2 form which posts the form data to a postgres DB using a Rest API. Now, I want to serve my Angular 2 app on AWS S3. I googled on this and I found that creating a webpack is a solution but not able to create one. I want to know where to start with, to bundle my code and serve it on s3.
GitHub link for Form: https://github.com/aanirudhraj/Angular2form_signaturepad_API
Thanks for the Help!!
The quickest way is to build the app using angular-cli and then deploy the content of the 'dist' directory as a static site in S3 (an S3 bucket can be configured to host a static site; make sure you assing read permission to 'anybody' to avoid http 4xx return codes).
You just need to host it as a static site on S3.
Check this: http://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html
I infer from your code that you are using angular-cli.
Create a dev/production build
ng build --dev / ng build --prod
Content of your dist folder will contain bundled files for deployment. Your primary file for refrence will be 'index.html' as this will load you angular app.
You need to decide what kind of server you'll be using to serve you webapp.
For development purpose when we do ng serve , webpack-dev-server is used as a static file server (local development). I'll recommend should go with the most comfortable/cost effective solution you can have when deploying to actual server.
Static file Server
Directly hosting website is aws space as a static website.
Aspnet Core with static file server middleware. (*)
Nodejs Express with static file server middleware.(*)
Java serverlet for serving static files. (*)
(*)Following aproach will also allow you to have some server-side code if you require in future.
When you deploy your ng2-app, you should use AOT(ahead of time) compile.
I guess you are using JIT(just in time) compile.
In angular2 guide page,
With AOT, the browser downloads a pre-compiled version of the application. The browser loads executable code so it can render the application immediately, without waiting to compile the app first.
When you use JIT compile, your browser will download vendor.js which is defined by angular2 compiler and it will compile your app just in time. It will be too slow and your client have to download vendor file. When you use AOT, you dont have to use vendor file, so resources are being smaller.
I recommend to use AOT compile when you deploy your app, and use lazy loading for resource size.
If you are curious about ng2 AOT compile, read this guide.
angualar2-cookbook-AOT
And here is example angular2 app with webpack2 and lazy load.
use file structure and config files in here.
When I tested with example app, files bundled with aot was smaller than 500KB.
angular2-webpack2-aot
When you use aot compile with #ngtools/webpack or whatever,
just put all files in dist directory which have files compiled with aot in your S3 bucket, and I recommend to use aws cloudfront cache for your s3 bucket resources.

JAX-WS Web Services on Tomcat 8 – JAX-WS Library Files Location?

For a normal JSP web-app that provides web-services, where should the JAX-WS library jar files be placed?
<tomcat-home>/lib
or
<web-app>/WEB-INF/lib
and why?
In general, when are library files considered part of the container infrastructure or part of the web application?
DETAILS
I have implemented various JAX-WS web services following, among others, these guides:
https://jax-ws.java.net/2.2.10/docs
https://jaxenter.com/creating-soap-web-services-using-jax-ws-117689.html
http://www.mkyong.com/webservices/jax-ws/deploy-jax-ws-web-services-on-tomcat/
http://examples.javacodegeeks.com/enterprise-java/jws/jax-ws-web-services-on-tomcat/
http://www.java2blog.com/2013/03/jaxws-webservice-deployement-on-tomcat.html
Whilst the above guides were useful, there are differences in terms of both the required JAX-WS library jar files and where the JAX-WS library jar files should reside.
By trial and error, for JDK 1.8, Tomcat 8.0.30 & JAS-WS 2.2.10, this is the list of JAX-WS library jars that seem to be required:
gmbal-api-only.jar
ha-api.jar
jaxb-core.jar
jaxb-impl.jar
jaxws-api.jar
jaxws-rt.jar
management-api.jar
policy.jar
stax-ex.jar
streambuffer.jar
I am aware that the JDK contains some of the JAX-WS classes but these seem to be meant for standalone Java apps
ie all of the above jar files seem to be needed to avoid a ClassNotFoundException etc.
I have read the Tomcat 8 class-loader how-to
and appreciate that there is a parent-tree, hierarchal class loader and that jar files in:
<web-app>/WEB-INF/lib
are only available to that web app ie are hidden from other web apps
causes the app war file(s) to be bloated as each web app has it’s own copy
and that jar files in:
<tomcat-home>/lib
are available to and shared by all web apps
forces all web apps to use the same version of the library
libraries must be inter web-app shareable ie no statics, thread-safe etc
enables lookup via a JNDI Resource Factory eg JDBC, mail etc
suppresses memory leaks for DriverManager eg JDBC
The web services seem to work when the JAX-WS library jar files are in either location.
Looking at the Metro JAX-WS project,
where the JAX-WS library jars must be downloaded from, for now, I have put these into <tomcat-home>/lib as that is consistent with the ‘install’ option in the ant file.
As a general rule, I try not to pollute the web-container / app-server with unnecessary library jar files where possible as this can lead to conflicts for other web-apps that have to use a specific version of a required library.
Thanks for reading.
Had the same issue trying to deploy a web service to my local tomcat installation. I went the route of adding the jars you listed to get it going, but see the instructions of what's needed from Apache:
https://tomcat.apache.org/tomcat-8.0-doc/extras.html#Web_Services_support_(JSR_109)
...which I think will go a long way to minimizing the amount of jars that end up in your Tomcat's lib folder.

How to start using a downloaded plugin?

I recently downloaded two plugins, https://github.com/harvesthq/chosen and https://github.com/fredwu/jquery-endless-scroll. I extracted the files. Now what? I'm guessing for a start I have to move the files somewhere. I'm just trying to figure out how to 'install' them into my app. There are tutorials for how to use the plugins after they're installed, but none on the actual installation.
I have a rails 4.0.10 app, if that matters.
The Rails way of doing it would be to put any 3rd party lib under vendor/assets. JS files in the javascripts directory and CSS files in the stylesheets. The you need to require the files in either the application.js or application.css files. Doing this will ensure that the files get compiled and minified within the Asset Pipeline of your application.
EDIT #1:
Information about organizing application assets http://guides.rubyonrails.org/asset_pipeline.html#asset-organization
EDIT #2:
I highly recommend using the Rails Assets framework when using 3rd party libs. Makes managing assets much easier.

How do I host static files in WSO2 Carbon 3.2.2?

I have installed WSO2 Carbon 3.2.2 and would like to host some static files that I can access from a browser (specifically, a variety of HTML and JavaScript files that make up a working website). I want to be able to access the files from http://localhost:9763/<MY_FILES>. With Carbon 3.0.0 this was as simple as putting the files in <CARBON_HOME>/webapps/. Carbon 3.2.2 does not have the <CARBON_HOME>/webapps/ directory, and adding it doesn't help.
I noticed that (after installing certain features) there is another webapps directory located <CARBON_HOME>/repository/deployment/server/webapps/, but that appears to be specifically for deploying war files.
I've tried putting my files everywhere I can think of, but I've had no luck.
Is there a feature that I have to install? Is there a special location to put these files? Is this still a supported feature?
This is never been an advertised feature of Carbon nor it has been recommended. Hence you can't expect to have backward compatibility for a "non feature".
The right thing to in a production environment is to use a web server (Apache, nginx etc...) to serve static files because web servers are optimized to do that. Then proxy the connections to Carbon via the web server. For example, by using mod_proxy for Apache.
You can still use the Application Server (or after installing AppServer features into any Carbon server) to create a .war file and have your static site there. Then again if it's a static site using Application Server is an overkill.

Free SVN repo server without requiring a project

I want to know if there are any free Subversion repository hosting servers where you don't need to have a 'project' to host your C++ files in.
I don't have a actual project, but I want to store my C++ in an SVN repository. I am looking for something like OpenSVN where you can upload your C++ files, but it requires you to have a project.
Can you recommend a Subversion hosting service where you can upload your files to an account, rather than a project. Something like: http://www.test-svn.com/~nathanpc/
Have you tried Assembla? It's free and you don't need to have a project.