old_contents: import { Router } from 'express'
  import fs from 'fs'
  
  const router = Router()
  
  router.get('/', (req, res) => {
    fs.readFile('./data', 'utf8', (err, data) => {
      if (err) {
        res.status(500).send(err || { message: 'Internal Error' })
      } else {
        res.status(200).send(JSON.parse(data))
      }
    })
  })
  
  router.post('/', (req, res) => {
    const { lat, long } = req.body
    console.log(`body: ${JSON.parse(req.body)}`)
    console.log(`lat: ${lat}, long: ${long}`)
    const data = { lat, long }
    fs.writeFile('./data', JSON.stringify(data), (err) => {
      if (err) {
        res.status(500).send(err || { message: 'Internal Error' })
      } else {
        res.status(200).send({ message: 'Success' })
      }
    })
  })
  
  export default router
  
new_contents: import { Router } from 'express'
  import fs from 'fs'
  
  const router = Router()
  
  router.get('/', (req, res) => {
    fs.readFile('./data', 'utf8', (err, data) => {
      if (err) {
        res.status(500).send(err || { message: 'Internal Error' })
      } else {
        res.status(200).send(JSON.parse(data))
      }
    })
  })
  
  router.post('/', (req, res) => {
    const { lat, long } = req.body
    console.log(`body: ${JSON.stringify(req.body)}`)
    console.log(`lat: ${lat}, long: ${long}`)
    const data = { lat, long }
    fs.writeFile('./data', JSON.stringify(data), (err) => {
      if (err) {
        res.status(500).send(err || { message: 'Internal Error' })
      } else {
        res.status(200).send({ message: 'Success' })
      }
    })
  })
  
  export default router
  
subject: change json.parse to json.stringify