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

Allow cli to work on local files #1

Open
patcon opened this issue Sep 22, 2014 · 3 comments
Open

Allow cli to work on local files #1

patcon opened this issue Sep 22, 2014 · 3 comments

Comments

@patcon
Copy link

patcon commented Sep 22, 2014

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!

@xchellx
Copy link

xchellx commented May 20, 2021

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".

@patcon
Copy link
Author

patcon commented May 21, 2021

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!

@xchellx
Copy link

xchellx commented May 21, 2021

I got it to work using https://www.npmjs.com/package/serve-me
inside package.json:

  "scripts": {
    "main": "node index.js"
  }

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");
});

npm run main in a separate cli
then do node node_modules\maximize\maximize.js http://localhost:8000/myscript.min.js
it works!

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

2 participants