Http-server: how could i make the url differ from the actual path ?

Created on 6 Oct 2016  路  1Comment  路  Source: http-party/http-server

My scene is to use it as API server so the front-end can make mock-test. that means, my url may be very complex, but in fact I have only several json files to show data.
for instance:
my api url: http://some.com/api/version1.0/food
my json file: /data/mock/food.json

When I run http-server, i don't want to make-up the path with many useless empty dirs to match the url, i just want to use the simple and existing dir. How do i make this ? many thanks !

Most helpful comment

You should mock the request function when running frontend tests. In there, you can assert that they are called with the right arguments.

>All comments

You should mock the request function when running frontend tests. In there, you can assert that they are called with the right arguments.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jiyinyiyong picture jiyinyiyong  路  6Comments

dumptyd picture dumptyd  路  4Comments

laughinghan picture laughinghan  路  5Comments

arthurkhlghatyan picture arthurkhlghatyan  路  3Comments

ducklord picture ducklord  路  5Comments