Giter VIP home page Giter VIP logo

Comments (8)

snyoz avatar snyoz commented on August 19, 2024

In other words:

is it possible to open a static file structure path in the URL without mentioning it in the config.json?

Maybe: "apimocker/static/folder/index.html"

from apimocker.

gstroup avatar gstroup commented on August 19, 2024

@snyoz
Sorry I have been busy with work and traveling. But I should have some time to work on this today. So, I originally intended for apimocker to only return API responses, like JSON or XML. I didn't think it would be useful to return images. Just curious, why do you need it to return static images? I thought images would be served up by the same web/app server that serves your app? Anyway… I think I can open a static path as you describe. I'll try to get that done today or maybe tomorrow. Thanks!

from apimocker.

snyoz avatar snyoz commented on August 19, 2024

Thanks for your answer!
The problem is that I've got 387 of images files in 100 different nested in directorys.
My current solution is that I also installed "grunt-contrib-connect" . So I run an additional image server as grunt task to view the static image directory-tree. it works! but it would be more satisfying to run it 'all in one' with your apimocker on the same port. :)

Kind regards!

from apimocker.

gstroup avatar gstroup commented on August 19, 2024

@snyoz I just checked in support for this feature. Set "staticDirectory" and "staticPath" in your config.json file. Let me know how that works. Thanks!

from apimocker.

snyoz avatar snyoz commented on August 19, 2024

do you mean this way?

I have added this to my config.json:

"app/test": {
"verbs": ["get"],
"staticDirectory":"static/test"
},

from apimocker.

gstroup avatar gstroup commented on August 19, 2024

You also need to add "staticPath" and I think both need a leading slash. Path is for the URL you use to access the static directory.

Good luck!

-Greg

On Jul 11, 2014, at 4:39 PM, "Kevin Bacon (Official)" [email protected] wrote:

do you mean this way?

I have added this to my config.json:

"app/test": {
"verbs": ["get"],
"staticDirectory":"static/test"
},


Reply to this email directly or view it on GitHub.

from apimocker.

gstroup avatar gstroup commented on August 19, 2024

Also, not inside the "webservices" section of the config. Should be at the top level. There's a sample on the readme page.

Hope this helps.

-Greg

On Jul 11, 2014, at 4:39 PM, "Kevin Bacon (Official)" [email protected] wrote:

do you mean this way?

I have added this to my config.json:

"app/test": {
"verbs": ["get"],
"staticDirectory":"static/test"
},


Reply to this email directly or view it on GitHub.

from apimocker.

snyoz avatar snyoz commented on August 19, 2024

Awesome! It helps a lot!!!! Great, thank you very much.

from apimocker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.