mirror of
				https://github.com/zadam/trilium.git
				synced 2025-11-03 20:06:08 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			24 lines
		
	
	
		
			667 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			24 lines
		
	
	
		
			667 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
"use strict";
 | 
						|
 | 
						|
const express = require('express');
 | 
						|
const router = express.Router();
 | 
						|
const auth = require('../../services/auth');
 | 
						|
const sql = require('../../services/sql');
 | 
						|
const migration = require('../../services/migration');
 | 
						|
 | 
						|
router.get('', auth.checkApiAuthWithoutMigration, async (req, res, next) => {
 | 
						|
    res.send({
 | 
						|
        'db_version': parseInt(await sql.getOption('db_version')),
 | 
						|
        'app_db_version': migration.APP_DB_VERSION
 | 
						|
    });
 | 
						|
});
 | 
						|
 | 
						|
router.post('', auth.checkApiAuthWithoutMigration, async (req, res, next) => {
 | 
						|
    const migrations = await migration.migrate();
 | 
						|
 | 
						|
    res.send({
 | 
						|
        'migrations': migrations
 | 
						|
    });
 | 
						|
});
 | 
						|
 | 
						|
module.exports = router; |