chore(nx/server): move source code

This commit is contained in:
Elian Doran 2025-04-22 17:16:41 +03:00
parent 9c0d42252e
commit b2af043110
No known key found for this signature in database
889 changed files with 10 additions and 30 deletions

View File

@ -1,13 +0,0 @@
/*
* Make sure not to import any modules that depend on localized messages via i18next here, as the initializations
* are loaded later and will result in an empty string.
*/
import { initializeTranslations } from "./services/i18n.js";
async function startApplication() {
await import("./www.js");
}
await initializeTranslations();
await startApplication();

View File

@ -2,6 +2,7 @@
"name": "@triliumnext/server",
"version": "0.0.1",
"private": true,
"type": "module",
"nx": {
"targets": {
"serve": {

View File

@ -1,21 +1,13 @@
/**
* This is not a production server yet!
* This is only a minimal backend to get started.
/*
* Make sure not to import any modules that depend on localized messages via i18next here, as the initializations
* are loaded later and will result in an empty string.
*/
import express from 'express';
import * as path from 'path';
import { initializeTranslations } from "./services/i18n.js";
const app = express();
async function startApplication() {
await import("./www.js");
}
app.use('/assets', express.static(path.join(__dirname, 'assets')));
app.get('/api', (req, res) => {
res.send({ message: 'Welcome to server!' });
});
const port = process.env.PORT || 3333;
const server = app.listen(port, () => {
console.log(`Listening at http://localhost:${port}/api`);
});
server.on('error', console.error);
await initializeTranslations();
await startApplication();

Some files were not shown because too many files have changed in this diff Show More