|
|
@ -1,6 +1,8 @@
|
|
|
|
import express, { Request, Response, NextFunction, RequestHandler, json as BodyParserJson } from 'express';
|
|
|
|
import express, { Request, Response, NextFunction, RequestHandler, json as BodyParserJson } from 'express';
|
|
|
|
import fs from 'fs-extra';
|
|
|
|
import fs from 'fs-extra';
|
|
|
|
import { path, isProd } from '@tycrek/joint';
|
|
|
|
import { path, isProd } from '@tycrek/joint';
|
|
|
|
|
|
|
|
import { epcss } from '@tycrek/express-postcss';
|
|
|
|
|
|
|
|
import tailwindcss from 'tailwindcss';
|
|
|
|
import { log } from './log';
|
|
|
|
import { log } from './log';
|
|
|
|
import { ServerConfiguration } from 'ass';
|
|
|
|
import { ServerConfiguration } from 'ass';
|
|
|
|
|
|
|
|
|
|
|
@ -63,6 +65,18 @@ async function main() {
|
|
|
|
app.use(BodyParserJson());
|
|
|
|
app.use(BodyParserJson());
|
|
|
|
app.use(assMetaMiddleware(serverConfig.port, serverConfig.proxied));
|
|
|
|
app.use(assMetaMiddleware(serverConfig.port, serverConfig.proxied));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// CSS
|
|
|
|
|
|
|
|
app.use('/.css', epcss({
|
|
|
|
|
|
|
|
cssPath: path.join('tailwind2.css'),
|
|
|
|
|
|
|
|
plugins: [
|
|
|
|
|
|
|
|
tailwindcss,
|
|
|
|
|
|
|
|
(await import('autoprefixer')).default(),
|
|
|
|
|
|
|
|
(await import('cssnano')).default(),
|
|
|
|
|
|
|
|
(await import('@tinycreek/postcss-font-magician')).default(),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
warn: (warning: Error) => log.warn('PostCSS', warning.toString())
|
|
|
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
|
|
|
|
app.get('/.ass.host', (req, res) => res.send(req.ass.host));
|
|
|
|
app.get('/.ass.host', (req, res) => res.send(req.ass.host));
|
|
|
|
|
|
|
|
|
|
|
|
// Routing
|
|
|
|
// Routing
|
|
|
|