chore(nx/server): move source code
@ -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();
 | 
					 | 
				
			||||||
@ -2,6 +2,7 @@
 | 
				
			|||||||
  "name": "@triliumnext/server",
 | 
					  "name": "@triliumnext/server",
 | 
				
			||||||
  "version": "0.0.1",
 | 
					  "version": "0.0.1",
 | 
				
			||||||
  "private": true,
 | 
					  "private": true,
 | 
				
			||||||
 | 
					  "type": "module",
 | 
				
			||||||
  "nx": {
 | 
					  "nx": {
 | 
				
			||||||
    "targets": {
 | 
					    "targets": {
 | 
				
			||||||
      "serve": {
 | 
					      "serve": {
 | 
				
			||||||
 | 
				
			|||||||
@ -1,21 +1,13 @@
 | 
				
			|||||||
/**
 | 
					/*
 | 
				
			||||||
 * This is not a production server yet!
 | 
					 * Make sure not to import any modules that depend on localized messages via i18next here, as the initializations
 | 
				
			||||||
 * This is only a minimal backend to get started.
 | 
					 * are loaded later and will result in an empty string.
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import express from 'express';
 | 
					import { initializeTranslations } from "./services/i18n.js";
 | 
				
			||||||
import * as path from 'path';
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
const app = express();
 | 
					async function startApplication() {
 | 
				
			||||||
 | 
					    await import("./www.js");
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
app.use('/assets', express.static(path.join(__dirname, 'assets')));
 | 
					await initializeTranslations();
 | 
				
			||||||
 | 
					await startApplication();
 | 
				
			||||||
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);
 | 
					 | 
				
			||||||
 | 
				
			|||||||
| 
		 Before Width: | Height: | Size: 186 KiB After Width: | Height: | Size: 186 KiB  | 
| 
		 Before Width: | Height: | Size: 168 KiB After Width: | Height: | Size: 168 KiB  | 
| 
		 Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 43 KiB  | 
| 
		 Before Width: | Height: | Size: 172 KiB After Width: | Height: | Size: 172 KiB  | 
| 
		 Before Width: | Height: | Size: 167 KiB After Width: | Height: | Size: 167 KiB  | 
| 
		 Before Width: | Height: | Size: 237 KiB After Width: | Height: | Size: 237 KiB  | 
| 
		 Before Width: | Height: | Size: 202 KiB After Width: | Height: | Size: 202 KiB  | 
| 
		 Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 49 KiB  | 
| 
		 Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 80 KiB  | 
| 
		 Before Width: | Height: | Size: 191 KiB After Width: | Height: | Size: 191 KiB  | 
| 
		 Before Width: | Height: | Size: 47 KiB After Width: | Height: | Size: 47 KiB  | 
| 
		 Before Width: | Height: | Size: 270 KiB After Width: | Height: | Size: 270 KiB  | 
| 
		 Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB  | 
| 
		 Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB  | 
| 
		 Before Width: | Height: | Size: 89 KiB After Width: | Height: | Size: 89 KiB  | 
| 
		 Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 5.3 KiB  | 
| 
		 Before Width: | Height: | Size: 198 KiB After Width: | Height: | Size: 198 KiB  | 
| 
		 Before Width: | Height: | Size: 175 KiB After Width: | Height: | Size: 175 KiB  | 
| 
		 Before Width: | Height: | Size: 76 KiB After Width: | Height: | Size: 76 KiB  | 
| 
		 Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB  | 
| 
		 Before Width: | Height: | Size: 59 KiB After Width: | Height: | Size: 59 KiB  | 
| 
		 Before Width: | Height: | Size: 158 KiB After Width: | Height: | Size: 158 KiB  | 
| 
		 Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 68 KiB  | 
| 
		 Before Width: | Height: | Size: 113 KiB After Width: | Height: | Size: 113 KiB  | 
| 
		 Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 44 KiB  | 
| 
		 Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB  | 
| 
		 Before Width: | Height: | Size: 53 KiB After Width: | Height: | Size: 53 KiB  |