Sorry if my question is trivial, but I am new to Polymer.
I have gone through the Polymer CLI tutorial, here:
https://www.polymer-project.org/1.0/start/toolbox/set-up
I have created the app in a sub-folder on my server, here:
https://mi-linux.wlv.ac.uk/~in9352/web-components/polymer/my-app/
But as you can see in the browser console, I am getting errors relating to the base URL, and the fact that Polymer seems to be looking for files on the root by default.
Now I have just read all sorts of advice on the web, tried different things, but no success. I have reverted all my failed attempts back to the fresh install (I think).
Where do I go from here?
Cheers :)
Related
I've been getting this error while trying to create a script file to automate a little of the codePush deployment process.
Looking at all the information I could find online wasn't helping - In the script I echo'd the PWD to see that I am running the code-push release-react command from the correct location in my .sh file, I am including react-native as a package dependency in my package.json. Everything looked fine, but I was still getting the error.
Since I found the issue but couldn't find anything online to point to what the problem was, I'll post the answer below.
Upon playing with the scripts in my package.json I tried running npm install again to make sure everything was setup properly when I get an error that actually showed me my issue.
The problem was the JSON in my package.json had become corrupted - the syntax wasn't spot on. I had started playing with the json in the file and forgot to revert the changes I made when I finished and had an extra comma.
Now that almost a whole day is gone, I can get back to work.
I am new to developing but I want to experiment with making changes to this code my friend made for a site we are working on. This is the github link:
https://github.com/415DomSmith/ADA_Map
I've opened html files with chrome before to view them but that doesnt seem to work here. Opening views/landing.ejs with chrome doesnt render the whole site.
Here is a screenshot of the main folder contents:
main folder contents screenshot
So my question is what program can I use to render and make edits to the code? Can brackets do it? I've tried with no luck.
Thanks!
cd ${the root path of the project}
npm install
node app.js
visit localhost:3000 in the browser.
According to your description, I think you are new of nodejs and express.
If you want to understand it thoroughly, you must study below.
npm package
nodejs
express
I have site hosted on OpenShift with two pages. The main page works fine- loads right up. The second page, however, comes up totally blank. All of the sources are missing when I use Chrome's Inspect Element tool. The html file is blank and the additional subdirectories (js, css, etc) are just gone.
I'm not getting any errors in the log beyond a "js-bson: Failed to load c++ bson extension, using pure JS version" that I can't figure out but doesn't appear relevant.
The page worked fine for a while but started occurring today when I tried to change the content.
Why would this happen?
It sounds like you haven't committed the latest version of your files to your OpenShift git repository. You need to make sure to perform a git commit before doing a git push
If that isn't the problem, use the rhc ssh command detailed here to log into your application gear and see what files exist there. That may give you some clue as to what the problem is.
I have been learning web development for some time and I have noticed on tutorials on youtube that when someone change source file (html, css, js) the webpage opened in browser is automatically refreshing. I have read something about live-reload but it's too complicated for me and there is no step by step tutorial.
I have found some similar questions, but the case is that refreshing happens by side of local server not the code editor or browser as is mentioned in questions that I found.
I'm using Apache as my local server. Sublime Text for writing a code and Ubuntu operating system.
Here is the video that shows what I am exactly trying to say.
https://www.youtube.com/watch?v=q78u9lBXvj0
Npm and live-server doesn't work on my computer at all.
Sorry for my english, but I'm not a native speaker. I'm looking forward for your help.
Anyone knows anything?
Install sublime web server using package manager ( or in your case continue to use Apache )
Use http://livejs.com/
I was using a Chrome shortcut with allow-file-access-from-files in the target to work on my three.js student project files. But sometime this morning this stopped working and it appeared Chrome had been updated. I redid the shortcut but no joy.
Part of the project I'm doing is building three.js animation that works in a common browser (for which I chose Chrome).
Is there any way to get Chrome to allow file access again?
Thanks.
The answer I came up with was to use Firefox instead of Chrome changing the security policy as detailed in https://github.com/mrdoob/three.js/wiki/How-to-run-things-locally
Not a perfect answer but with a deadline looming it's the best workable answer for me right now as trying different variations of Chrome, trying Wamp and also Mongoose didn't work. If I had more time I would work out how to use Python or probably node.js as I've seen it mentioned a number of times as being the faster option.
What gman stated is true, using the Chrome flag (and changing Firefox's security policy) does create a big security risk. But only if you use that shortcut (and it's tabs etc.) for anything other than accessing your own local files. I've been scrupulous about not using it for the internet but don't use this method if you can't be strict with yourself.
Ideally I'd recommend beginning any project with node.js.
Gman's answer is good. If you're in windows environment, and use npm for package management the easiest is to install http-server globally:
npm install -g http-server
Then simply run http-server in any of your project directories:
Eg. d:\my_project> http-server
Starting up http-server, serving ./
Available on:
http:169.254.116.232:8080
http:192.168.88.1:8080
http:192.168.0.7:8080
http:127.0.0.1:8080
Hit CTRL-C to stop the server
Easy, and no security risk of accidentally leaving your browser open vulnerable.
DON'T USE THAT FLAG! You're opening yourself to having your online accounts being hacked and your local data stolen. Here are 2 proof of concept examples
Run a simple server.
It's super simple.
Here's one
Here's one.
Here's another.
And another.
They won't take more than a couple of minutes to download and require no configuration