Files
the-example-app-nodejs/README.md
Benedikt Rötsch 5a20ed0dbc new deployment (#59)
* Production (#44)

* test: Fix integration test

* fix: Fix Editorial feature

* chore(localization): move locales to i18n folder

* feat(modules): add image caption and shadow

* fix: clarify German translation🇩🇪

* chore(localization): fix typo (#47)

* Split first paragraph into sections (#46)

* feat(controls): add help text to API dropdown

* fix(style): simplify header and fix mobile design

* fix(style): simplify footer and fix mobile design

* fix(style): update stylesheet and scripts file

* test(e2e): adjust tests and make them fail on CI

* language fixes

* rename labels to use full api name

* Refactor entry state toggle (#48)

* chore(editorialFeatures): extract editorial features toggle

* chore(refactor): rename function to make more contextual sense

* Fix breadcrumb and add test for locales (#49)

* test(unit): add test to check for locale consistency

* fix(breadcrumb): translate lessons route

* Change readme url to http from https (#52)

* tests(e2e): expect only 2 courses

* fix(cookies): fix variable naming and extend to two days maxAge

* Change text on next lesson button (#54)

* Retranslate advancedLabel

* fix(translations): do not break on vim temp files. This is dedicated to JP

* fix(analytics): use correct app-id

* Add instructions to seed a space to readme (#61)

* Change modal text; add link to model's repo to localization files (#57)

* fix(links): link correct GH repository

* fix(i18n): adjust view on github link label

* fix(style): move GitHub link to the left

* new screenshot
2017-11-09 16:36:06 +01:00

52 lines
3.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
## The node.js Example App
The node.js Example App aims at getting across the very basics of how to work with our headless content management system and how to build apps using our officially supported JavaScript SDK. Youll learn best practices for using the SDK to deliver content to your app and additionally learn some techniques for modelling your content in Contentful.
We hope this app will give you a better understanding of how decoupling content from its presentation enables greater flexibility and facilitates shipping higher quality software more quickly.
Contentful is a content management platform for web applications, mobile apps and connected devices. It allows you to create, edit and manage content in the cloud and publish it anywhere via powerful API. Contentful offers tools for managing editorial teams and enabling cooperation between organizations.
<a href="https://the-example-app-nodejs.herokuapp.com/" target="_blank"><img src="https://images.contentful.com/qz0n5cdakyl9/4GZmvrdodGM6CksMCkkAEq/700a527b8203d4d3ccd3c303c5b3e2aa/the-example-app.png" alt="Screenshot of the example app"/></a>
## Requirements
* Node 8
* Git
Without any changes, this app is connected to a Contentful space that is not publicly accessible. The full end-to-end Contentful experience requires you to clone this space to your own Contentful account, and enables you to see how content editing in the Contentful web app and see those changes propagate to this running application. Signing up and getting started with our free plan is... free!
You can clone the space for this example app to your own Contentful account by using our CLI tool.
```
contentful space seed -s '<SPACE_ID>' -t the-example-app
```
If you do not have the Contentful CLI installed you can find instructions on installation and usage [here](https://github.com/contentful/contentful-cli). For more information on the content model check out [this repo](https://github.com/contentful/content-models/tree/master/the-example-app/README.md).
Once youve created a space, you can change the credentials in the variables.env. If you dont feel like changing code immediately, you can also inject credentials via url parameters like so:
```
http://localhost:3000?space_id=<YOUR_CLONED_SPACE_ID>&delivery_token=<YOUR_DELIVERY_TOKEN>&preview_token=<YOUR_PREVIEW_TOKEN>
```
## Installing the Node.js app
```bash
git clone https://github.com/contentful/the-example-app.nodejs.git
```
```bash
npm install
```
## Running the Node.js app
To start the server, run the following
```bash
npm run start:dev
```
Open [https://localhost:3000](https://localhost:3000) and take a look around. If you have configured the app to connect to a space that you own, use [https://localhost:3000?enable_editorial_features](https://localhost:3000?enable_editorial_features). This URL flag adds an “Edit” button in the app on every editable piece of content which will take you back to Contentful web app where you can make changes. It also adds “Draft” and “Pending Changes” status indicators to all content if relevant.