How to use the typescript-rest.Server.setFileDest function in typescript-rest

To help you get started, we’ve selected a few typescript-rest examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github vellengs / typerx / packages / server / src / application.ts View on Github external
private setUploadsFolder() {
    const uploads = path.resolve(process.cwd(), 'public', 'uploads');
    Server.setFileDest(uploads);
  }
github Soluto / tweek / services / authoring / src / routes / index.ts View on Github external
{ from: 'keys', to: 'key' },
    { from: 'manifests', to: 'manifest' },
    { from: 'revision-history', to: 'revision-history' },
    { from: 'dependents', to: 'dependent' },
    { from: 'resource/policy', to: 'resource/policy' },
  ];

  prefixes.forEach((prefix) => {
    app.all(`/${prefix.from}/*`, (req, res, next) => {
      req.query['keyPath'] = req.params[0];
      req.url = `/${prefix.to}`;
      next();
    });
  });

  Server.setFileDest('uploads/');
  Server.buildServices(
    app,
    AppsController,
    TagsController,
    SearchController,
    BulkKeysUpload,
    SchemaController,
    KeysController,
    PolicyController,
    ResourcePolicyController,
    SubjectExtractionRulesController,
  );

  return app;
}