mirror of
https://github.com/zadam/trilium.git
synced 2025-11-07 05:46:10 +01:00
chore(nx): create empty project for server
This commit is contained in:
21
apps/server/src/main.ts
Normal file
21
apps/server/src/main.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
/**
|
||||
* This is not a production server yet!
|
||||
* This is only a minimal backend to get started.
|
||||
*/
|
||||
|
||||
import express from 'express';
|
||||
import * as path from 'path';
|
||||
|
||||
const app = express();
|
||||
|
||||
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);
|
||||
Reference in New Issue
Block a user