docker-json-server icon indicating copy to clipboard operation
docker-json-server copied to clipboard

Getting error of "Error: Data must be an object." when running through docker, but not if I just start json-server normally through cli

Open MostHated opened this issue 5 years ago • 1 comments

Hello,
For some reason I keep getting the error of "Error: Data must be an object." when running through docker, but not if I just start json-server normally through cli.

This is the run.sh I was trying to use

#!/bin/bash

args="$@"

args="$@"
host="-H 0.0.0.0"
port="-p 9004"
dest="http://mysite.com/news/index.json"

json-server $args $port $host $dest

If I just run it like this, it works just fine. :

json-server -p 9004 -H 0.0.0.0 http://mysite.com/news/index.json

Thanks, -MH

MostHated avatar May 04 '20 22:05 MostHated

Hi @MostHated

I just created another version of docker-json-server. It comes with much flexibility just like json-server as CLI.

It might be helpful for you 🌹

isdzulqor avatar Oct 12 '21 10:10 isdzulqor