Skip to content

Demo app for the "Setting up Content Previews" course By Contentful Learning Services.

License

Notifications You must be signed in to change notification settings

contentful/preview-demo

Repository files navigation

Setting up Content Previews

This is a demo app for the Content Previews course on our Learning Center.

Requirements

  • Node.js
  • Contentful API keys

Step 1

Create an empty space in Contentful and note the API keys (delivery, preview and management). From the Contentful web app go to SPACE SETTINGS --> API keys....

Step 2

After downloading this repo, open the project's location on your computer and run "npm install" from your terminal window to install the dependencies.

Step 3

After installing the dependencies run the "npm run setup" command to configure the app. type in the keys at the prompt.

Step 4

Run the app with "npm run dev".

Step 5

Open the link http://localhost:9009/ on your browser.

Step 6

Setup preview on the Contentful web app, your preview URL should be a combination of your app's URL and your preview secret (from step 3) for example: http://localhost:9009/api/preview?secret=testing&slug={entry.fields.slug}

Go to the Contentful Web app --> SPACE SETTINGS --> Content preview.

Setup preview for the Post content model and use a url like the below;

http://localhost:9009/api/preview?secret=your-preview-secret&slug={entry.fields.slug}

About

Demo app for the "Setting up Content Previews" course By Contentful Learning Services.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published