json - mimicking the behavior of a web-api with static folders -


the problem. have access static web site. built web-api mvc , node sent data based on id passed instance.

http://10.10.10.10:5000/api/blueprint/191 (where 191 id) 

this return json string [ json ] after looking in database table. table 1000 records.

could mimic same behavior returning files static website? files "blueprint/191.json" instance. files kept statically on web server.

thoughts?

> <?php  /*   * change license header, choose license headers in project     properties.  * change template file, choose tools | templates  * , open template in editor.  */     header("access-control-allow-origin: *"); header('content-type: application/json'); /* @var $_get type */ $typeid = $_get['typeid']; $data = file_get_contents($typeid.".json"); echo $data; 

Comments

Popular posts from this blog

unity3d - Rotate an object to face an opposite direction -

angular - Is it possible to get native element for formControl? -

javascript - Why jQuery Select box change event is now working? -