Open zoutepopcorn opened 6 years ago
I'm running JSON server from my nodejs process.
It's real simple, but for my program I want a default template. I did not find it, so I use:
const jsonServer = require('json-server') const server = jsonServer.create() const fs = require('fs'); if (!fs.existsSync('db.json')) { fs.writeFileSync('db.json', JSON.stringify({ "couters": [{ "persons": 0 }], "persons": [] })); } const router = jsonServer.router('./db.json') const express = require('express'); const middlewares = jsonServer.defaults() ....
I realy would like to like
const jsonServer = require('json-server') const server = jsonServer.create() const router = jsonServer.router('./db.json',{ "couters": [{ "persons": 0 }], "persons": [] }) ...
Is this possible?
https://github.com/dfsq/json-server-init
I'm running JSON server from my nodejs process.
It's real simple, but for my program I want a default template. I did not find it, so I use:
I realy would like to like
Is this possible?