Database.json Link

: Always include a unique id for each post so you can find or delete it later.

: JSON requires double quotes for keys and string values; single quotes will cause an error.

In your terminal, run: npx json-server --watch database.json

import json new_post = {"id": 1, "title": "Hello from Python", "content": "Writing to JSON is easy!"} # Load existing data with open('database.json', 'r+') as file: db = json.load(file) db['posts'].append(new_post) # Seek to start and overwrite file.seek(0) json.dump(db, file, indent=2) Use code with caution. Copied to clipboard Best Practices for database.json

You can now send a POST request to http://localhost:3000/posts using fetch in JavaScript: javascript