The simplest and most practical Node.js backend template, suitable for quickly setting up small-scale backends.
最爽的方式起个 Nodejs 小后端
pnpm i
pnpm dev
All db operations are in db.js. And data is under ./data
db_connectto create and connect dbdb_insertto add datadb_findto return array of datadb_removeto remove data
How to export the data to json?
export.jsto modifynamevariable andpnpm export
You can write backend APIs in api.js
And socket APIs in socket_api.js
All sessions store under the ./sessions
Please place all static files under ./public. And use url /static/... to access.
pnpm vue
It will create a frontend dir with a Vue Vite project named frontend.
And you should modify the api.js to cancel the comment code beside // for vue project inside
All Python files should be under pyscript.
Run shell setup.sh to setup the python enviroment.
And please write python functions in server.py
To call the function, write in the api.js use the call_py() function.
You can use it like template repo into new repos.