當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。