mirror of
https://github.com/laurent22/joplin.git
synced 2025-01-08 13:06:15 +02:00
22 lines
626 B
TypeScript
22 lines
626 B
TypeScript
import { SubPath } from '../../utils/routeUtils';
|
|
import Router from '../../utils/Router';
|
|
import { RouteType } from '../../utils/types';
|
|
import { AppContext } from '../../utils/types';
|
|
import { contextSessionId } from '../../utils/requestUtils';
|
|
import { ErrorMethodNotAllowed } from '../../utils/errors';
|
|
import defaultView from '../../utils/defaultView';
|
|
|
|
const router: Router = new Router(RouteType.Web);
|
|
|
|
router.get('home', async (_path: SubPath, ctx: AppContext) => {
|
|
contextSessionId(ctx);
|
|
|
|
if (ctx.method === 'GET') {
|
|
return defaultView('home');
|
|
}
|
|
|
|
throw new ErrorMethodNotAllowed();
|
|
});
|
|
|
|
export default router;
|