stefanjudis / grunt-photobox

Grunt plugin for creating screenshots of any site and compare them
MIT License
276 stars 22 forks source link

Photobox with connect or express server #29

Closed dtothefp closed 10 years ago

dtothefp commented 10 years ago

I've been trying to implement grunt-photobox on a current project and cannot seem to get it to generate the photobox directory. Before implementing a local server I ran the grunt photobox task and it generated the photobox directory with the img > last directory and created an index.html page showing diffs and kittens, but since implementing a server I cannot get the task to produce any results. The terminal output upon running the photobox task is

Done, without errors.

I've tried implementing this in a local environment running both an express and connect server. Essentially, I have tried running the server in one terminal tab and in another tab running the photobox grunt task from within the repo. Here are examples

Connect: https://github.com/dtothefp/grunt-photobox-connect

Express: https://github.com/dtothefp/grunt-photobox-express

-- In both cases a watch is setup on the main.css file to run the photobox task upon any change.

stefanjudis commented 10 years ago

Hey thanks for creating the issue.

Please provide gruntfile, photobox version and node version. So that I can have a deeper look on it. :bowtie:

Output of grunt execution with --verbose flag may also help. :)

dtothefp commented 10 years ago

Using node version 0.10.29 and photobox version 0.8.0. Gruntfiles are here

https://github.com/dtothefp/grunt-photobox-connect/blob/master/Gruntfile.js https://github.com/dtothefp/grunt-photobox-express/blob/master/Gruntfile.js

and you can clone either/both repos to see if you get the same results. I've attached screenshots of running

grunt photobox --verbose

Look forward to hearing back screen shot 2014-07-06 at 3 51 38 pm screen shot 2014-07-06 at 3 50 53 pm

stefanjudis commented 10 years ago

Great... Will have a look now. :)

stefanjudis commented 10 years ago

EDITED:

  grunt.initConfig( {
    pkg: grunt.file.readJSON('package.json'),

    photobox: {
      local : {
        options: {
          urls: [ 'http://localhost:3000' ],
          screenSizes: [ '400', '600', '1200' ],
          indexPath: 'public/photobox/'
        }
      }
    }
  }

Try that one. :)

stefanjudis commented 10 years ago

Please feel free to ask further questions or to close the issue. :)

dtothefp commented 10 years ago

That didn't have any affect. I'm confused, I though the url was the path to the page where screenshots should be taken?

stefanjudis commented 10 years ago

Ahh shit... sorry - bad example.

It's more about the local, please define the task to execute...

It work's with localhost:3000, too.

And defining sizes with 400x600 is depcretated. Please use the screenwidth, only. :)

dtothefp commented 10 years ago

Awesome that seems to work now, it was the missing target and probably the size definition messing it up. I'm going to work to implement it into my current project and will close the issue if successful

stefanjudis commented 10 years ago

Great. Glad I could help. :+1: :smile: