API template for HTML page that provides data to the user based on the given ID.
data | ||
.gitignore | ||
index.js | ||
LICENSE | ||
package-lock.json | ||
package.json | ||
README.md |
Dynamic Content Delivery API
API template for Dynamic Content Delivery - HTML page that provides data to the user based on the given ID.
Which files am I allowed to edit?
- all files in
data
directory:
How to use
- Clone this repository.
- Install Node.js and npm.
- Install dependencies:
npm install
- Edit required files:
- config.json:
- edit your constants:
- provide your API port in
PORT
constant.
- provide your API port in
- edit your constants:
- data-source.json:
- provide your data in
DATA
constant like this:
{ "id1": { "#name": { "textContent": "John", "style": { "color": "red" } } }, "id2": { "#name": { "textContent": "Anna", "style": { "color": "blue" } } } }
Warning
Do not change the structure of the
DATA
object. It must be an object with keys being IDs and values, which are objects with CSS selectors as keys and objects with DOM properties as values. Make sure that your API is running on the same port as the one provided inPORT
constant. - provide your data in
- config.json:
- Run the API:
npm start
License
This project is licensed under the MIT License - see the LICENSE file for details.
Authors
- @sadorowo - original author