backend-common: add resolvePackagePath

This commit is contained in:
Patrik Oldsberg
2020-09-01 18:58:33 +02:00
parent 320b77e75b
commit c319de51a7
6 changed files with 53 additions and 23 deletions
+4 -5
View File
@@ -14,17 +14,16 @@
* limitations under the License.
*/
import { errorHandler } from '@backstage/backend-common';
import { errorHandler, resolvePackagePath } from '@backstage/backend-common';
import express from 'express';
import Router from 'express-promise-router';
import { Logger } from 'winston';
import fs from 'fs';
import path from 'path';
import { ApolloServer } from 'apollo-server-express';
const schemaPath = path.resolve(
require.resolve('@backstage/plugin-graphql-backend/package.json'),
'../schema.gql',
const schemaPath = resolvePackagePath(
'@backstage/plugin-graphql-backend',
'schema.gql',
);
export interface RouterOptions {