-
Notifications
You must be signed in to change notification settings - Fork 41
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
Allow cli to work on local files #1
Comments
Hello @patcon. What exactly did you do for a solution on loading files from local storage? I tried serving from a Python SimpleHTTPServer and used various NodeJS local server hosters but keep getting "Failed to retrieve entire script". |
Ah shoot, I don't recall, but I suspect it would have been something like what you did. Maybe try loading the script elsewhere, as perhaps there's just a missing close bracket on something, and that's compounding the trouble-shooting? Or maybe try with a really simple file at first, in case the parse is somehow getting tripped up on something :) Good luck! |
I got it to work using https://www.npmjs.com/package/serve-me "scripts": {
"main": "node index.js"
}
//Require the module
ServeMe = require("serve-me");
//Set the options
var serveMe = ServeMe({
debug: true,
/**If debug mode is enabled, it will load each file again every http request, else the files will wait in cache.
* Also prints more logs
**/
log: true,
//(Optional) If log is enabled the server reports all the files served and more information.
home: "index.html",
//(Optional) home will change the html file served in "/" (by default: 'index.html')
directory: ".",
//(Optional) directory will change the default public folder ('./public')
error: {
404: "404.html",
500: "500.html"
/**Error pages depending on the error code.
* That specified files must exist in the 'public/error' folder.
* Model: 'errorcode': "file.html"
**/
},
//(Optional)
secure: false,
//Will use https when enabled.
//ATENTION: A key and a certificate must be provided.
//By default serve-me will use:
key: "./keys/key.pem",
cert: "./keys/cert.pem",
});
//Also you can add a callback to wait for the server to start.
serveMe.start(8000, function(){
console.log("Hosting current directory on localhost:8000");
});
|
Hey! Nice tool. Not sure if there's any reason the
file://
protocol shouldn't work, but it was a use-case for me that I had to find another solution for. Thanks!The text was updated successfully, but these errors were encountered: