API template for HTML page that provides data to the user based on the given ID.
Go to file
2024-06-05 09:56:57 -05:00
data add: API files 2024-03-10 13:38:06 +01:00
.gitignore add: API files 2024-03-10 13:38:06 +01:00
index.js add: API files 2024-03-10 13:38:06 +01:00
LICENSE Initial commit 2024-03-08 13:37:23 +01:00
package-lock.json add: API files 2024-03-10 13:38:06 +01:00
package.json add: API files 2024-03-10 13:38:06 +01:00
README.md update: README 2024-06-05 09:56:57 -05:00

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?

How to use

  1. Clone this repository.
  2. Install Node.js and npm.
  3. Install dependencies:
    npm install
    
  4. Edit required files:
    1. config.json:
      • edit your constants:
        1. provide your API port in PORT constant.
    2. 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 in PORT constant.

  5. Run the API:
    npm start
    

License

This project is licensed under the MIT License - see the LICENSE file for details.

Authors