mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
readme update, code uncomment
This commit is contained in:
parent
88423719e5
commit
6d02af2fe1
2 changed files with 19 additions and 8 deletions
11
README.md
11
README.md
|
@ -113,6 +113,17 @@ the public key.
|
|||
To start syncing user \#1 should perform a get request to `/syncp2pdata`. Received new questions are
|
||||
automatically sent to registered peers.
|
||||
|
||||
`/syncp2pdata` accepts a few query parameters:
|
||||
|
||||
| Name | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| allTime | boolean | If it should ignore the last sync date, and get all data |
|
||||
| users | boolean | If it should sync users |
|
||||
| questions | boolean | If it should sync questions |
|
||||
|
||||
If `users` and `questions` are all missing, then everything will be synced. The last sync date is
|
||||
stored separately for them.
|
||||
|
||||
If the peer doesn't have a https server (only http) then `http: true` should be specified in
|
||||
`peers.json`
|
||||
|
||||
|
|
|
@ -1338,15 +1338,15 @@ function setup(data: SubmoduleData): Submodule {
|
|||
const questions = !!req.query.questions
|
||||
const users = !!req.query.users
|
||||
const allTime = !!req.query.allTime
|
||||
// const user = req.session.user
|
||||
const user = req.session.user
|
||||
|
||||
// if (!user || user.id !== 1) {
|
||||
// res.json({
|
||||
// status: 'error',
|
||||
// message: 'only user 1 can call this EP',
|
||||
// })
|
||||
// return
|
||||
// }
|
||||
if (!user || user.id !== 1) {
|
||||
res.json({
|
||||
status: 'error',
|
||||
message: 'only user 1 can call this EP',
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
// FIXME: /syncResult EP if this EP times out, but we still need the result
|
||||
if (syncInProgress) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue