0

I can start and run my Angular app fine from my local computer. But I have never run it on a server before.

I have tried uploading it to the server. On the server I type the following to start it:

http-server

Then I visit http://serverip:8080/. Instead of seeing my app I see:

Index of /

(-rw-rw-r--)    847B    app.js
(-rw-rw-r--)    748B    index.htm

Node.js v0.10.25/ ecstatic server running @ 195.189.182.160:8080

What is missing in my configuration?

1 Answer 1

1

ecstatic is a static file server. It's not set up to be a web server by default, even though it can work that way. When you do run it as a web server, certain standard options in most web servers - like treating a request for /path/ as a request for /path/index.htm - are disabled by default.

You need to enable opts.autoIndex. The package readme tells you how to do that. In your case, it means editing http-server or the .js file that it fires off; it's hard to say from what you have posted.

Sign up to request clarification or add additional context in comments.

3 Comments

That sounds complicated. Is any other web server simpler to run Angular from for a beginner? I'm at the stage where I need a step by step tutorial to follow to succeed.
@user1283776 You can use whatever you want - Apache, nginx, a simple node.js listener, or whatever. You will have to run it on top of something, however. Software recommendations and recommendations for tutorials are off-topic for SO, but you should have no problem finding them in a search engine. You might also look at this question and its answers.
Only node.js, only single language for both -ends

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.