mirror of https://github.com/andrigamerita/simpkey
beta.2
This commit is contained in:
parent
d4163b3644
commit
6dc760f11b
|
@ -1,3 +1,4 @@
|
||||||
node_modules
|
node_modules
|
||||||
built
|
built
|
||||||
yarn-error.log
|
yarn-error.log
|
||||||
|
config.json
|
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"port": 4000
|
||||||
|
}
|
15
src/app.ts
15
src/app.ts
|
@ -1,18 +1,23 @@
|
||||||
import Koa from 'koa';
|
import Koa from 'koa';
|
||||||
import { router } from './router';
|
|
||||||
import config from './config';
|
|
||||||
import bodyParser from 'koa-bodyparser';
|
import bodyParser from 'koa-bodyparser';
|
||||||
import { render } from './render';
|
|
||||||
|
|
||||||
|
import { router } from './router';
|
||||||
|
import constant from './const';
|
||||||
|
import { render } from './render';
|
||||||
|
import fs from 'fs';
|
||||||
|
|
||||||
|
const conf = JSON.parse(fs.readFileSync(__dirname + '/../config.json', 'utf-8'));
|
||||||
|
|
||||||
const app = new Koa();
|
const app = new Koa();
|
||||||
|
|
||||||
console.log('Simpkey v' + config.version);
|
console.log('Simpkey v' + constant.version);
|
||||||
|
|
||||||
app.use(bodyParser());
|
app.use(bodyParser());
|
||||||
app.use(render);
|
app.use(render);
|
||||||
app.use(router.routes());
|
app.use(router.routes());
|
||||||
|
|
||||||
|
console.log(`listening port ${conf.port}...`);
|
||||||
|
|
||||||
console.log('App launched!');
|
console.log('App launched!');
|
||||||
|
|
||||||
app.listen(3000);
|
app.listen(conf.port || 3000);
|
|
@ -3,13 +3,13 @@ import { parse, toHtml } from 'mfmf';
|
||||||
import { parsePlain } from 'mfmf/dist/script/mfm/parse';
|
import { parsePlain } from 'mfmf/dist/script/mfm/parse';
|
||||||
|
|
||||||
|
|
||||||
import config from './config';
|
import constant from './const';
|
||||||
import { User } from './models/User';
|
import { User } from './models/User';
|
||||||
import { Note } from './models/Note';
|
import { Note } from './models/Note';
|
||||||
|
|
||||||
export const render = views(__dirname + '/views', {
|
export const render = views(__dirname + '/views', {
|
||||||
extension: 'pug', options: {
|
extension: 'pug', options: {
|
||||||
...config,
|
...constant,
|
||||||
mfmToHtml: (text: string, plain = false) => {
|
mfmToHtml: (text: string, plain = false) => {
|
||||||
return toHtml(plain ? parsePlain(text) : parse(text), [], {
|
return toHtml(plain ? parsePlain(text) : parse(text), [], {
|
||||||
url: '',
|
url: '',
|
||||||
|
|
|
@ -147,8 +147,8 @@ mixin user-header(user, detail = false)
|
||||||
.sex 性別: #{user.sex}
|
.sex 性別: #{user.sex}
|
||||||
dl
|
dl
|
||||||
each field in user.fields
|
each field in user.fields
|
||||||
dt= mfmToHtml(field.name)
|
dt !{mfmToHtml(field.name)}
|
||||||
dd= mfmToHtml(field.value)
|
dd !{mfmToHtml(field.value)}
|
||||||
|
|
||||||
.count
|
.count
|
||||||
a.notes(href="/" + getAcct(user)) #{user.notesCount} ノート
|
a.notes(href="/" + getAcct(user)) #{user.notesCount} ノート
|
||||||
|
|
|
@ -2,6 +2,7 @@ extends _base
|
||||||
|
|
||||||
block content
|
block content
|
||||||
p Simpkey は、JavaScript のいらない Misskey クライアントです。
|
p Simpkey は、JavaScript のいらない Misskey クライアントです。
|
||||||
|
p: a(href="https://github.com/xeltica/simpkey", target="_blank", rel="noopener noreferrer") リポジトリを見る
|
||||||
h2 バージョン #{version}
|
h2 バージョン #{version}
|
||||||
ul
|
ul
|
||||||
each val in changelog
|
each val in changelog
|
||||||
|
|
Loading…
Reference in New Issue