From 0e244d2b3024db6a41eb202e2ab940ae8b19cc4f Mon Sep 17 00:00:00 2001 From: Erwin Date: Sat, 28 Mar 2026 03:14:22 +0000 Subject: [PATCH] feat: basic entry point and health check --- src/index.js | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 src/index.js diff --git a/src/index.js b/src/index.js new file mode 100644 index 0000000..a2fc36e --- /dev/null +++ b/src/index.js @@ -0,0 +1,36 @@ +/** + * SimpleNote Web - Entry Point + * Document management API with nested libraries and markdown support + */ + +import express from 'express'; +import { fileURLToPath } from 'url'; +import { dirname, join } from 'path'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); + +const app = express(); +const PORT = process.env.PORT || 3000; + +// Middleware +app.use(express.json()); +app.use(express.urlencoded({ extended: true })); + +// Health check +app.get('/health', (req, res) => { + res.json({ status: 'ok', timestamp: new Date().toISOString() }); +}); + +// TODO: Routes +// - /api/documents +// - /api/libraries +// - /api/tags +// - /api/auth + +// Start server +app.listen(PORT, () => { + console.log(`SimpleNote Web running on port ${PORT}`); +}); + +export default app;