• database.json
database.json

Update your property details

Simply email your photos, facilities list or any other information that you'd like to update to this email address.

Please ensure to include the name and address of your property. Please attach your best photos - better presentation means more business for your property.

Get Direct Bookings

We can help you get more direct bookings, own the relationship with your guests, build your brand and lower your distribution costs.

There are no setup costs or risky per click fees. Simply email us here to find out more.
INR is the avg. rate/night this week in Gurgaon

Database.json Direct

const fs = require('fs'); const newPost = { id: Date.now(), title: "Direct Write", content: "Added via fs module" }; // 1. Read the existing file const data = fs.readFileSync('database.json'); const db = JSON.parse(data); // 2. Add the new post db.posts.push(newPost); // 3. Write it back fs.writeFileSync('database.json', JSON.stringify(db, null, 2)); Use code with caution. Copied to clipboard 3. Using Python Python is often used for simple JSON "databases":

To write a new entry (a "post") to a database.json file, you can either use a tool like for a quick mock API or write a script in a language like JavaScript (Node.js) or Python to handle the file operations directly. 1. Using json-server (Quickest for Web Devs) database.json

fetch('http://localhost:3000/posts', { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ title: "My First Post", content: "This is some data saved to database.json!" }), }) .then(response => response.json()) .then(data => console.log('Success:', data)); Use code with caution. Copied to clipboard 2. Using Node.js (Direct File Writing) const fs = require('fs'); const newPost = { id: Date

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

Create a database.json with an initial structure: { "posts": [] } Use code with caution. Copied to clipboard

Check-rates.com confirms availability and rates by searching hundreds of travel sites at the same time, allowing to instantly compare hotel details, rates and taxes from such websites.
For full terms & conditions click here. Prices displayed are subject to change at any time.

Check-Rates.com - more hotels, more deals, more availability!

Never miss the FREE hottest deals:

We'll send you amazing hotel deals every week!

Prices updated on: Sun Dec 14, 2025 02:25am EDT

Use your mobile or tablet to find the best hotel deals:

  • Compare 1000s of travel sites on the go
  • Search for hotels near your current location
  • 800,000+ hotels with images, ratings and more
  • Best price anywhere guaranteed!
Copyright © 2004-2025 Check-Rates.com™. All rights reserved.