Can ".htaccess" file work with npm's "http-server" command?
Asked Answered
E

1

6

This is probably a rookie question, but although the npm http-server page states:

...http-server is a simple, zero-configuration command-line http server...

Does this mean it completely disregards an .htaccess file? If so, is there another (yet still simple to use) HTTP server alternative that reads and uses it?

Ealdorman answered 14/5, 2015 at 23:37 Comment(2)
.htaccess is an Apache thing. What do you need it for if you're using node?Baleful
Ah sorry, my misunderstanding. I've only been using node / npm to launch the http-server, but I need to handle this mime-type AddType text/cache-manifest appcache manifest. I've only found the .htaccess solution, if something similar exists for node, I can ask a different question.Ealdorman
S
7

.htaccess is an Apache configuration file. Since Apache isn't npm, Apache configuration files will obviously not work for npm.

Npm uses environment variables and npmrc files to configure things. See this documentation page.

In your case it looks like that this might do what you want it to do.

Silkworm answered 15/5, 2015 at 12:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.