I have multiple screens (i.e. pages) in a python buildpack - watson service app. I am trying to create a simple hyperlink to another screen. Bluemix deployment starts the app at designer-index.html.
appfile structure
I am using this source for a hyperlink in the app:
xxxxx-xxxxx.mybluemix.net/templates/vehicle-selector.html
Currently I get a 404 - The requested URL was not found on the server.
Am I missing the mark with context root?
Files in the templates directory are usually rendered
#app.route('/vehicle')
def showVehicle():
return render_template('vehicle-selector.html')
Static files go in the static directory
Related
I'd like to deploy a React app built with create-react-app within my company's CMS. I can't host assets on the CMS, just the script tag, css tag and root DIV. I've deployed the static assets to S3 and pointed my publicPath to AWS, but in my CSS the components are not rendered. I'm new to webpack configuration and unsure where to turn.
There are only two ways where to build assets for deploy:
build assets on local machine and deploy static files
deploy sources to server and perform assets building there
There are some differences. For example first way may require more data to transfer, and second way requires more complicated configuration on server. Server must have possibility to execute different tools including webpack and have enough place for node modules.
I have a react project code. I want to deploy it on google cloud. I have a build directory in my project which has builds. Here is my project structure.
How can I deploy it on google cloud. Can someone please guide me. What all files from my project will I have to put there. I am very new to deploying apps online.
Will I need to just put the build folder or will I need to upload complete project there?
React apps are single page applications. Single page applications (SPA) can be hosted as a static website on google cloud storage. Here is the link for hosting a static website on GCP. Similarly, If you want to host reactJS app on AWS S3, here are the steps.
Host the index.html in the root folder of your bucket. Store your bundled react app.js file to sub folders and specify the path in index.html. You can also store other public assets in sub-folder hierarchy.
I made an AngularJS App on its own and a NodeJS app seperately, but what I'm trying to do now is make a fusion of both. Either by putting the nodeJS app inside the AngularJS App or the other way around.
I know that it's better to have NodeJS app serve API that will be consumed by AngularJS App but I only want one server for the whole thing and I think it's doable since when I make an AngularJS app there is already a folder called "node_modules".
The structure of my project now is :
AngularApp folders (in which there is the whole AngularJS app)
node_modules (in which I loaded express, mysql and what I'd need in Node.js App)
independently: NodeApp.js (the NodeJS app that contains the code of node)
However, when I run app.js/index.html it throws the following error: "can't get index.html", meaning that even though they're in the same project, AngularJS and NodeJS don't communicate. Can you please help me with this? How can I make the link between AngularJS and NodeJS if I want to make them both in the same Webstorm project?
Thanks in advance.
I found this in my research:
http://www.infragistics.com/community/blogs/dhananjay_kumar/archive/2015/02/13/how-to-use-nodejs-express-and-bower-to-create-angularjs-apps.aspx
it is what I want to do but I didn't understand everything since it's easier using Webstorm
You should start a new app using Express Generator and check out the folder structure it creates.
I have a small app built with expressjs and angularjs, here's the folder structure:
bin
config
models
node_modules
public
javascripts
In here all the angular crap (in sub folders of course)
routes
test
views
index.html (this is my main html file, here is where angular loads)
app.js
To do this I had to change the views engine to work with .html
Then when you access localhost:3000 the server renders index.html (localhost:3000/#/) which loads angular and all the crap along.
All my angular resources go to /api/yourModel.
So if you access localhost:3000/api/yourModel you are accesing the api directly.
For me this works just fine, and as you say you have everything together. The front end and the server in the same "project" sort of speak.
As suggested by user1655756 , what I did was make a new nodeJS application and then instead of public, I injected the angularJS app folder.
Then as suggested by Shaffanhoon in node.js I specified the path to my index.html and that's what worked for me ..
Thank you for all your help
I am trying to optimize an existing UI5 application which resides in SAP BW as BSP Application and runs from SAP Portal (You press on the link and the UI5 application opens in a new Tab).
My main concern is with the amount of calls between Client and Back-end system. Especially calling all the library.css/library-preload.js/etc files AND custem controller.js and view.js files.
I found possible solutions involving grunt/gulp or deploying from SAP WebIDE. I trying building and deploying the App with SAP WebIDE, but after opening the App, Network still shows a lot of traffic + there is no Component-preload.js call. I'm guessing it has something to do with where the app is launched or I still have some configuring to do on the back-end?
I would like to build my App with either grunt/gulp since I can involve other plugins like lints, compression (for js, html, css), test, and many more. The problem is that the App resides not in OS, but somewhere in DB.
So I want to build my App with all those Grunt/Gulp tasks and deploy to ABAP AS (in BW as BSP application) using ABAP Team Provider and ensure that when I call the app from Portal, the files will be compressed/minified and, what is more important, that all the relevant .js files will be loaded as a single request.
Is what I imagine even possible? And if yes, then what are the steps required to accomplish this?
NOTE: I checked SCN and unfortunately I can't use your typical npm grunt or grunt-openui5 etc since the App resides somewhere in the DB :/
If you have a build configuration inside your WebIDE project, WebIDE will reate a DIST folder containing the distribution package.
Inside DIST there is an autogenerated Component-preload.js
I created a very simple simulator of my app in my landing page website. The way i do it locally is in the index.html of my landing page i run (ionic serve) the app through an iframe like this:
<iframe src="http://localhost:8100/#/tab/home"></iframe>
My problem is how do I reference the source when i upload it in my web hosting.
my file structure looks like this
x myLandingPage
>index.html //landing page
x mysimulator
x www
x templates
>index.html //ionic app
edit: Ionic 1.2 officially supports deployment as a website!
Let's assume your site is hosted at example.com domain and that you have a folder called myLandingPage at the root of your server and that you can access it online via http://example.com/myLandingPage/index.html. In that case you would use the following iframe tag in your index.html file:
<iframe src="mysimulator/www/templates/index.html"></iframe>
So, once you upload your app to your hosting, you won't have to run ionic serve, because when you do that locally you actually start a local web server which then serves this content. Once you upload your files to your server that step is then of course not needed.
Hope this helps. Btw, I see one thing that looks a bit off from the standard Ionic setting and that is the placement of your index.html file inside the templates folder. Usually it is in the www folder. So, in case you misplaced the file in the file structure it could be that the src will be
<iframe src="mysimulator/www/index.html"></iframe>
but I hope you get the point and will be able to find your way.