mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-23 19:36:56 -08:00
api/v1/instance endpoint, for fedidb
This commit is contained in:
parent
b02704ed82
commit
1e38fcf9b3
1 changed files with 17 additions and 0 deletions
|
@ -117,6 +117,23 @@ def nodeinfo2():
|
|||
return jsonify(nodeinfo_data)
|
||||
|
||||
|
||||
@bp.route('/api/v1/instance')
|
||||
@cache.cached(timeout=600)
|
||||
def api_v1_instance():
|
||||
retval = {
|
||||
'title': g.site.name,
|
||||
'uri': current_app.config['SERVER_NAME'],
|
||||
'stats': {
|
||||
"user_count": users_total(),
|
||||
"status_count": local_posts() + local_comments(),
|
||||
"domain_count": 1
|
||||
},
|
||||
'registrations': g.site.registration_mode != 'Closed',
|
||||
'approval_required': g.site.registration_mode == 'RequireApplication'
|
||||
}
|
||||
return jsonify(retval)
|
||||
|
||||
|
||||
@bp.route('/api/v1/instance/domain_blocks')
|
||||
@cache.cached(timeout=600)
|
||||
def domain_blocks():
|
||||
|
|
Loading…
Add table
Reference in a new issue