Skip to content

Releases: kktjs/kkt

v7.1.7

14 Apr 04:37
Compare
Choose a tag to compare

npm version

Documentation v7.1.7: https://raw.githack.com/kktjs/kkt/e17a652/index.html
Comparing Changes: v7.1.6...v7.1.7

v7.1.6

08 Apr 20:14
Compare
Choose a tag to compare

npm version

Documentation v7.1.6: https://raw.githack.com/kktjs/kkt/e17a652/index.html
Comparing Changes: v7.1.5...v7.1.6

v7.1.5

24 Feb 07:05
Compare
Choose a tag to compare

npm version npm bundle size

v7.1.4...v7.1.5

v7.1.4

24 Feb 05:42
Compare
Choose a tag to compare

npm version npm bundle size

v7.1.3...v7.1.4

v7.1.3

23 Feb 07:53
Compare
Choose a tag to compare

npm version npm bundle size

v7.1.2...v7.1.3

v7.1.2

23 Feb 06:54
Compare
Choose a tag to compare

npm version npm bundle size

v7.1.1...v7.1.2

v7.1.1

22 Feb 19:33
Compare
Choose a tag to compare

npm version npm bundle size

v7.1.0...v7.1.1

v7.1.0

08 Feb 10:37
Compare
Choose a tag to compare

npm version npm bundle size

v7.0.7...v7.1.0

New Features

import express from 'express';
import { WebpackConfiguration, MockerAPIOptions } from 'kkt';
export default (conf: WebpackConfiguration, evn: 'development' | 'production') => {
  //....
+  conf.proxySetup = (app: express.Application): MockerAPIOptions => {
+    return {
+      path: path.resolve('./mocker/index.js'),
+    };
+  };
  return conf;
}

Or:

Or use another way to manually configure the proxy.

import express from 'express';
import { createProxyMiddleware } from 'http-proxy-middleware';
import { MockerAPIOptions } from 'kkt';
/**
 * Still available, may be removed in the future. (仍然可用,将来可能会被删除。) 
 */
export const proxySetup = (app: express.Application): MockerAPIOptions => {
  app.use('/api', createProxyMiddleware({
    target: 'http://localhost:5000',
    changeOrigin: true,
  }));
  /**
   * Mocker API Options
   * https://www.npmjs.com/package/mocker-api
   */
  return {
    path: path.resolve('./mocker/index.js'),
    option: {
      proxy: {
        '/repos/(.*)': 'https://api.github.com/',
      },
      changeHost: true,
    }
  }
}

v7.0.7

25 Jan 08:18
Compare
Choose a tag to compare

npm version npm bundle size

v7.0.6...v7.0.7

v7.0.6

17 Jan 01:05
Compare
Choose a tag to compare

npm version npm bundle size

v7.0.5...v7.0.6