当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript feathers.default函数代码示例

本文整理汇总了TypeScript中@feathersjs/feathers.default函数的典型用法代码示例。如果您正苦于以下问题:TypeScript default函数的具体用法?TypeScript default怎么用?TypeScript default使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了default函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: it

    it('uses default configKey', () => {
      const otherApp = feathers();
      const otherAuth = new AuthenticationBase(otherApp);

      assert.ok(otherAuth);
      assert.strictEqual(otherApp.get('defaultAuthentication'), 'authentication');
      assert.deepStrictEqual(otherApp.get('authentication'), {});
    });
开发者ID:feathersjs,项目名称:feathers,代码行数:8,代码来源:core.test.ts

示例2: before

  before(() => {
    const restApp = express.default(feathers())
      .use(express.json())
      .configure(express.rest())
      .use(express.parseAuthentication('jwt'));
    app = getApp(restApp as unknown as FeathersApplication) as express.Application;
    app.use(express.errorHandler());

    server = app.listen(9776);
  });
开发者ID:feathersjs,项目名称:feathers,代码行数:10,代码来源:express.test.ts

示例3: it

  it('has app.channel', () => {
    const app = feathers().configure(channels());

    assert.strictEqual(typeof app.channel, 'function');
    assert.strictEqual(typeof (app as any)[keys.CHANNELS], 'object');
    assert.strictEqual(app.channels.length, 0);
  });
开发者ID:feathersjs,项目名称:feathers,代码行数:7,代码来源:index.test.ts

示例4: before

  before(() => {
    app = getApp(feathers().configure(primus({
      transformer: 'websockets'
    })));

    server = app.listen(port);
  });
开发者ID:feathersjs,项目名称:feathers,代码行数:7,代码来源:primus.test.ts

示例5: it

    it('errors when service does not exist', () => {
      const app = feathers();

      app.use('/authentication', new AuthenticationService(app));

      app.configure(express());
    });
开发者ID:feathersjs,项目名称:feathers,代码行数:7,代码来源:index.test.ts

示例6: beforeEach

  beforeEach(() => {
    connection = { testing: true };
    provider = new EventEmitter();

    options = {
      emit: 'emit',
      done: Promise.resolve(provider),
      socketKey: 'test',
      getParams () {
        return connection;
      }
    };
    app = feathers()
      .configure(commons(options))
      .use('/myservice', {
        get (id, params) {
          return Promise.resolve({ id, params });
        },

        create (data, params) {
          return Promise.resolve(Object.assign({ params }, data));
        }
      });

    return options.done;
  });
开发者ID:feathersjs,项目名称:feathers,代码行数:26,代码来源:index.test.ts

示例7: beforeEach

  beforeEach(() => {
    app = feathers().configure(routing());

    app.use('/my/service', {
      get (id: string|number) {
        return Promise.resolve({ id });
      }
    });
  });
开发者ID:feathersjs,项目名称:feathers,代码行数:9,代码来源:routing.test.ts

示例8: before

  before(() => {
    originalEnv.NODE_ENV = process.env.NODE_ENV;
    originalEnv.NODE_CONFIG_DIR = process.env.NODE_CONFIG_DIR;

    process.env.NODE_ENV = 'testing';
    process.env.NODE_CONFIG_DIR = join(__dirname, 'config');

    plugin = require('../lib');
    app = feathers().configure(plugin());
  });
开发者ID:feathersjs,项目名称:feathers,代码行数:10,代码来源:index.test.ts


注:本文中的@feathersjs/feathers.default函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。