/
githubmirror
/
next.js
Обзор
Документация
Войти
/
githubmirror
/
next.js
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
canary
examples/cms-contentful/lib/setup.js
22 строки
675 B
Steven
chore(examples): use default prettier for examples/templates (#60530)
12 янв 2024, 02:01
Не верифицирован
12 янв 2024, 02:01
4466ba4
Код
Авторство
О чём код?
const spaceImport = require("contentful-import"); const exportFile = require("./export.json"); const { CONTENTFUL_SPACE_ID, CONTENTFUL_MANAGEMENT_TOKEN } = process.env; if (!CONTENTFUL_SPACE_ID || !CONTENTFUL_MANAGEMENT_TOKEN) { throw new Error( [ "Parameters missing...", "Please run the setup command as follows", "CONTENTFUL_SPACE_ID=XXX CONTENTFUL_MANAGEMENT_TOKEN=CFPAT-XXX npm run setup", ].join("\n"), ); } spaceImport({ spaceId: CONTENTFUL_SPACE_ID, managementToken: CONTENTFUL_MANAGEMENT_TOKEN, content: exportFile, }) .then(() => console.log("The content model of your space is set up!")) .catch((e) => console.error(e));