Can Heroku websites read Server Side Includes - heroku

I am simply trying to reuse variables across multiple webpages on a heroku app. However, I keep getting that the variable is not found when trying to deploy.
I have saved as html file as shtml. I have also included this line without a script tag inside index.shtml.
Do heroku apps read server side includes?

Related

Is there a way to customize the Heroku internal server error page?

So, Heroku has some very limited documentation on how to customize error pages but I haven’t found documentation on how to modify the internal server error page. I would like to show a custom page so users at least get some guidance on why their query did not work properly. The internal server error is extremely ambiguous.
Here is an example of what the internal server error page currently looks like on my Heroku app…
The pages displayed to your users when the application encounters a system error or is placed in the maintenance state can be customized. Customizing these pages allows you to present a more consistent UI to your users.
Create and store the custom pages
Create your custom pages as static HTML. You may wish to use the default HTML served by Heroku as a template:
https://www.herokucdn.com/error-pages/application-error.html
https://www.herokucdn.com/error-pages/no-such-app.html
https://www.herokucdn.com/error-pages/maintenance-mode.html
https://www.herokucdn.com/error-pages/ssl-cert-error.html
You can reference images or CSS from the HTML as long as you use relative paths (for example, ) and you upload the other assets into the same place as the HTML.
You can host the pages anywhere that can serve web pages. It recommends uploading to Amazon S3. If you use S3, don’t forget to set the HTML and all assets to be publicly readable.
Configure your application
Set the ERROR_PAGE_URL and MAINTENANCE_PAGE_URL config vars to the publicly accessible URLs of your custom pages:
heroku config:set \
ERROR_PAGE_URL=//s3.amazonaws.com/<your_bucket>/your_error_page.html \
MAINTENANCE_PAGE_URL=//s3.amazonaws.com/<your_bucket>/your_maintenance_page.html
Refer this page : https://devcenter.heroku.com/articles/error-pages
Instead of trying to make a custom page for my first issue, I used programming logic to give user errors to preempt problems related to Heroku's Internal Server Error page when my application did not run appropriately. I highly suggest you think deeply before employing this method, as it could confuse users. The Heroku Internal Server Error page is an either-or reason code. While you know (as the programmer) only one reason code applies, since you've preempted the problem with logic, the user won't assume that. For me, it was better than the alternative - which was to leave it completely ambiguous. At least, I can give users some feedback.

How to correctly create expressjs app on facebook parse?

I'm learning http://parse.com and follow onsite tutorial to create expressjs "parse hosting" app.
I created a deployed simple app withou problems, it's accessible via <subdomain>.parseapp.com and displays public/index.html:
parse new
parse deploy
After that I generated expressjs app via:
parse generate
and modified main.js as instructed by adding following as a first string:
require('cloud/app.js');
Unfortunately, after deploying modified app it still displays index.html content. Seems it's some setting like "enable expressjs" that I can't see in documentation or app settings. Any hints?
Did you change the code in index.html? Express/Node is the server powering your app which is serving the index page. Unless you make changes to the HTML in the index page, you'll keep seeing the original generated file.

Include source code from different directory

I have three different domains all on the same server and I want to run the code on all three domains from one source on the same server, but not sure the best way.
Here's what I have:
domain01.com
domain02.com
domain03.com
domain04.com/sourcecode
I want domain01-03 to run the code inside domain04.com/sourcecode so the user can go to their domain and not have to go to domain04.com to see their site. I want to keep all the code inside domain04.com because I don't want to have to put the code inside each domain every time I make a code change.
For whatever reason I can't get my head around the best way to do this -- and want to do it right.
Any advice?
Thanks!
All you need to do is create a mapping on the first three sites to the appropriate directory in the fourth site, eg map /domain04 to /full/path/to/domain04/sourcecode, then refererence its CFML resources via /domain04 in CFC and include paths. The inference here is the code does need to be accessible via the file system for all sites concerned.
Note that if you also want to server non-CFML files via HTTP (eg: images, css, js), then you will also need a web server virtual directory along the same lines.
None of this requires a framework, it's standard CF / web server functionality.
Are you using a framework? One like ColdBox could make this trivial if your code is written modularly. (Disclaimer, I am affiliated with ColdBox)
If not, it really depends on what the code is. CFCs can be mapped anywhere via ColdFusion mappings. Even .cfm files can be included as long as the file systems are visible. If you're wanting to basically have complete copy of a site in another web root without duplication, I would first consider using a shared source control repo and a build process that checks it out in the appropriate places, and secondly a good old, symlink will also work .

how to serve or force file download located from a different directory in meteor to client browser

A user comes to my site and inputs something, and my site generates a file as an output.
Unfortunately i cannot place the generated file on the public directory - as you all now Meteor watches this and restarts every time the public folder content is changed.
so my generated files lives in .meteor/local/build/programs/server/files
so for example i have document.pdf that lives in that directory, I'd like to serve/force/trigger a file download to my client's browser that lets his browser download this document.pdf file.
In general Its not a very good idea to do this. It makes it very hard to scale your app. Node isn't good at serving chunky static files either.
Then also if you have two servers there is a slight chance that the other one's data is requested (e.g if you use a download manager).
I'm not sure but I think Meteor's live code reload doesn't work/is switched off in when in production mode (when using meteor deploy or meteor bundle)
The best thing to do would be to upload your file to S3 and then redirect the user to the file there.
You can also use Iron Router and server side routes to create a dynamic file download.
See Iron Router Server Side docs. Then you set your content type to application/pdf and send back the file directly without saving it to the filesystem. If you need to you can also save it in some other folder and serve it up yourself.
Then have a peek at this answer for an example of reading in and streaming out a file:
Node JS file downloads using a stream.
Since this is a server side route, using express and Iron Router, you shouldn't have to mess with any of the fibers related async issues.

How to open a test page with a url with a certain domain in path without deploying it to a server?

This seems like a simple question, but I just can't seem to wrap my head around it...
I have a simple html page. All that html page does is looks to see whether a browser cookie is present, and if it is, it will write a message that says "Found the cookie".
In order for this html page to work, it needs to be opened in a browser using a url that uses a specific domain "mytestsite.org" in the path in order to work. So I want to be able to open that page in a browser using a url like "www.mytestsite.org/mytestpage.html". Easy enough...
When I use this test page locally, I just deploy it to a local JBoss server, then make a mapping in my "hosts" file (I'm on Windows XP), that maps my local IP to "local.mytestsite.org". This tricks the browser into thinking that it is actually getting the page from "mytestsite.org", when it is actually being served by my local JBoss server.
I want to give this html file to another person who is going to use it on their pc. However, they don't have any sort of http server installed, so the little host mapping trick won't work. I don't want to make them go through the trouble of installing a server just to get this test page to work. Additionally, I can't physically put this file on "mytestsite.org".
Any thoughts on how I could open this page through a "mytestsite.org" url through a browser, without actually having it deployed to a server?
Is your test machine with JBoss installed accessible from the Internet? If so, you may ask the other person to add a mapping to their hosts file, that maps local.mytextsite.org to the public IP of your test machine.

Resources