diff --git a/plugins/scaffolder-backend/.eslintrc.js b/plugins/scaffolder-backend/.eslintrc.js index f50d2c3749..56b9c0bb2e 100644 --- a/plugins/scaffolder-backend/.eslintrc.js +++ b/plugins/scaffolder-backend/.eslintrc.js @@ -1,5 +1,6 @@ module.exports = { extends: [require.resolve('@backstage/cli/config/eslint')], + ignorePatterns: ['sample-templates/'], rules: { 'no-console': 0, // Permitted in console programs 'new-cap': ['error', { capIsNew: false }], // Because Express constructs things e.g. like 'const r = express.Router()' diff --git a/plugins/scaffolder-backend/src/index.ts b/plugins/scaffolder-backend/src/index.ts index b1d5683aa4..8c790c51f9 100644 --- a/plugins/scaffolder-backend/src/index.ts +++ b/plugins/scaffolder-backend/src/index.ts @@ -30,5 +30,15 @@ export const createScaffolder = (config?: TemplaterConfig & StorageConfig) => { res.status(200).json(templates); }); + router.post('/v1/job/create', async (_, res) => { + // TODO(blam): Actually make this function work' + + const mock = 'templateid'; + res.status(201).json({ accepted: true }); + + const path = await store.prepare(mock); + await templater.run({ directory: path, values: { componentId: 'test' } }); + }); + return router; };