{"size": 1258, "ext": "js", "max_stars_repo_path": "api/index.js", "max_stars_repo_name": "redgoose-dev/qtum-core-web", "max_stars_repo_stars_event_min_datetime": "2018-01-09T13:09:48.000Z", "max_stars_repo_stars_event_max_datetime": "2018-05-04T02:26:45.000Z", "max_issues_repo_path": "api/index.js", "max_issues_repo_name": "redgoose-dev/qtum-core-web", "max_issues_repo_issues_event_min_datetime": "2017-12-27T05:10:35.000Z", "max_issues_repo_issues_event_max_datetime": "2017-12-27T05:15:17.000Z", "max_forks_repo_path": "api/index.js", "max_forks_repo_name": "RedgooseDev/qtum-core-web", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 2, "max_issues_count": 1, "max_forks_count": null, "avg_line_length": 19.0606060606, "max_line_length": 58, "alphanum_fraction": 0.6224165342}
const express = require('express');
const router = express.Router();


// Transform req & res to have the same API as express
// So we can use res.status() & res.json()
const app = express();
router.use((req, res, next) => {
	Object.setPrototypeOf(req, app.request);
	Object.setPrototypeOf(res, app.response);
	req.res = res;
	res.req = req;
	next();
});


/**
 * init
 *
 * `getwalletinfo` 파라메터로 기초 정보를 요청하고 가져온다.
 * 코어가 작동되는지 검사용으로 사용
 */
router.post('/', require('./init'));

/**
 * dashboard
 */
router.get('/dashboard', require('./dashboard'));

/**
 * transactions
 */
router.get('/transactions', require('./transactions'));

/**
 * wallets
 */
router.get('/receive', require('./receive'));
router.post('/receive/add-address', require('./receive'));

/**
 * auth
 */
router.post('/login', require('./auth'));
router.post('/logout', require('./auth'));

/**
 * core
 */
router.post('/core-power', require('./core'));
router.post('/core-unlock', require('./core'));
router.post('/core-lock', require('./core'));
router.post('/core-change-testnet', require('./core'));

/**
 * etc
 */
router.post('/update-layout', require('./update-layout'));
router.get('/get-env', require('./get-env'));


// export
module.exports = {
	path: '/api',
	handler: router
};