hexo-server icon indicating copy to clipboard operation
hexo-server copied to clipboard

Add proxying support

Open 17320 opened this issue 6 years ago • 1 comments

This pull request implements two new hexo-serve options that allow a user to proxy certain paths to a remote target. Useful for example to test API integrations when the API endpoints are called via relative URLs from the static part of the site.

Example

Assuming that you have your API deployment running locally on port 3001, the following command will proxy all URLs starting with /api to localhost:3001.

hexo serve -P /api -U http:localhost:3001/

Note: The proxied paths must not already exist in the static part of the site.

17320 avatar Oct 05 '18 16:10 17320

Coverage Status

Coverage decreased (-0.4%) to 94.118% when pulling c63f52197eef32d22eda0141edfcd371971cfa11 on 17320:add-proxy-support into de57a8094dc0f8a7ab16ba28504e5c8527256cb2 on hexojs:master.

coveralls avatar Oct 05 '18 16:10 coveralls