summaryrefslogtreecommitdiff
path: root/src/server
diff options
context:
space:
mode:
Diffstat (limited to 'src/server')
-rw-r--r--src/server/api/endpoints/hashtags/search.ts2
-rw-r--r--src/server/api/endpoints/i/update.ts2
-rw-r--r--src/server/api/endpoints/users/search.ts2
-rw-r--r--src/server/api/private/signup.ts3
-rw-r--r--src/server/index.ts2
-rw-r--r--src/server/web/docs.ts6
6 files changed, 8 insertions, 9 deletions
diff --git a/src/server/api/endpoints/hashtags/search.ts b/src/server/api/endpoints/hashtags/search.ts
index 4d753808d4..d8a2156357 100644
--- a/src/server/api/endpoints/hashtags/search.ts
+++ b/src/server/api/endpoints/hashtags/search.ts
@@ -1,7 +1,7 @@
import $ from 'cafy';
import Hashtag from '../../../../models/hashtag';
import define from '../../define';
-const escapeRegexp = require('escape-regexp');
+import * as escapeRegexp from 'escape-regexp';
export const meta = {
desc: {
diff --git a/src/server/api/endpoints/i/update.ts b/src/server/api/endpoints/i/update.ts
index 4b02e393bf..d087687a51 100644
--- a/src/server/api/endpoints/i/update.ts
+++ b/src/server/api/endpoints/i/update.ts
@@ -9,7 +9,7 @@ import getDriveFileUrl from '../../../../misc/get-drive-file-url';
import { parse, parsePlain } from '../../../../mfm/parse';
import extractEmojis from '../../../../misc/extract-emojis';
import extractHashtags from '../../../../misc/extract-hashtags';
-const langmap = require('langmap');
+import * as langmap from 'langmap';
export const meta = {
desc: {
diff --git a/src/server/api/endpoints/users/search.ts b/src/server/api/endpoints/users/search.ts
index 86b16dcbb1..b0a789c7d5 100644
--- a/src/server/api/endpoints/users/search.ts
+++ b/src/server/api/endpoints/users/search.ts
@@ -1,5 +1,5 @@
import $ from 'cafy';
-const escapeRegexp = require('escape-regexp');
+import * as escapeRegexp from 'escape-regexp';
import User, { pack, validateUsername, IUser } from '../../../../models/user';
import define from '../../define';
diff --git a/src/server/api/private/signup.ts b/src/server/api/private/signup.ts
index b89629bcd1..6318eabdb8 100644
--- a/src/server/api/private/signup.ts
+++ b/src/server/api/private/signup.ts
@@ -8,14 +8,13 @@ import Meta from '../../../models/meta';
import RegistrationTicket from '../../../models/registration-tickets';
import usersChart from '../../../chart/users';
import fetchMeta from '../../../misc/fetch-meta';
+import * as recaptcha from 'recaptcha-promise';
export default async (ctx: Koa.BaseContext) => {
const body = ctx.request.body as any;
const instance = await fetchMeta();
- const recaptcha = require('recaptcha-promise');
-
// Verify recaptcha
// ただしテスト時はこの機構は障害となるため無効にする
if (process.env.NODE_ENV !== 'test' && instance.enableRecaptcha) {
diff --git a/src/server/index.ts b/src/server/index.ts
index 57f1326f2f..be0a6f5c77 100644
--- a/src/server/index.ts
+++ b/src/server/index.ts
@@ -13,7 +13,7 @@ import * as mount from 'koa-mount';
import * as compress from 'koa-compress';
import * as koaLogger from 'koa-logger';
import * as requestStats from 'request-stats';
-//const slow = require('koa-slow');
+//import * as slow from 'koa-slow';
import activityPub from './activitypub';
import webFinger from './webfinger';
diff --git a/src/server/web/docs.ts b/src/server/web/docs.ts
index f823c308c2..0597f50a9c 100644
--- a/src/server/web/docs.ts
+++ b/src/server/web/docs.ts
@@ -14,9 +14,9 @@ import * as glob from 'glob';
import * as yaml from 'js-yaml';
import config from '../../config';
import { licenseHtml } from '../../misc/license';
-const constants = require('../../const.json');
+import { copyright } from '../../const.json';
import endpoints from '../api/endpoints';
-const locales = require('../../../locales');
+import locales from '../../../locales';
import * as nestedProperty from 'nested-property';
function getLang(lang: string): string {
@@ -59,7 +59,7 @@ async function genVars(lang: string): Promise<{ [key: string]: any }> {
vars['config'] = config;
- vars['copyright'] = constants.copyright;
+ vars['copyright'] = copyright;
vars['license'] = licenseHtml;