Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Localhost set up Polymer 1.0 #4869

Closed
dev-ads opened this issue Oct 6, 2017 · 9 comments
Closed

Localhost set up Polymer 1.0 #4869

dev-ads opened this issue Oct 6, 2017 · 9 comments

Comments

@dev-ads
Copy link

dev-ads commented Oct 6, 2017

I am trying to set up polymer 1.0 on my Apple Mac.

I have been able to install Git, Node JS, Atom and Bower fine but I am not getting anything on any local host.

I have followed instructions on Polymer Project website but when running the polymer serve command in terminal in project directory I get nothing at localhost:8080/components/icon-toggle/demo/

I have attached the response I get from the polymer serve command in terminal. I have also tried to navigate to the link shown in the image but get a page not found error.

Quite new to this so any help is largely appreciated.
screenshot 2017-10-06 14 43 56

@web-padawan
Copy link
Contributor

web-padawan commented Oct 6, 2017

What kind of project do you have? See docs for element project and application project. You'll need to use other project templates for 1.x though, see this issue.

/cc @arthurevans

@dev-ads
Copy link
Author

dev-ads commented Oct 6, 2017

I would like to set up an elements project I believe. I need to use polymer 1.0

The polymer programming I have done so far has been using HTML files and importing bower components at the start of each document then calling an instance of that component.

@vaffonso
Copy link

vaffonso commented Oct 6, 2017

Probably port 8080 is already in use, so polymer serve is using 8081.
Try hitting localhost:8081

@dev-ads
Copy link
Author

dev-ads commented Oct 6, 2017

Returns "not found"

@dev-ads
Copy link
Author

dev-ads commented Oct 6, 2017

update: If I navigate to
http://localhost:8081/polymer-first-elements/demo/index.html
I get a white screen with some bower element errors (see attachment)
I'm fairly sure I have installed bower correctly (see attachment)
Again all help appareciated thank you

screenshot 2017-10-06 17 33 22

screenshot 2017-10-06 17 34 43

@vaffonso
Copy link

vaffonso commented Oct 6, 2017

Looks like port 8081 since you're having errors
If you're following google codelabs then you have a wrong path
localhost:8081/components/icon-toggle/demo/
as per this doc says
https://www.polymer-project.org/1.0/docs/start/reusableelements.html#local-dependencies

@dev-ads
Copy link
Author

dev-ads commented Oct 6, 2017

That produces the right page. Looks like Polymer serve is working now thank you all!
What is the best way of setting up a local host to create my own custom elements? Previously I have run a run.bat file with some Go programming code to set up a local host with an index.html file

Can I set something up that will work in a similar way?

Thanks again

@vaffonso
Copy link

vaffonso commented Oct 6, 2017

If I get it right, you can follow the same structure, in components folder, to build your own component. Then you can publish or wrap it for your own use.
https://www.webcomponents.org/publish

@dfreedm
Copy link
Member

dfreedm commented Oct 14, 2017

It sounds like you got the help you were looking for so I'm going to close this issue.

@dfreedm dfreedm closed this as completed Oct 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants