mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-31 20:22:27 +08:00
22 lines
516 B
TypeScript
22 lines
516 B
TypeScript
![]() |
/**
|
||
|
* 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);
|