feat: basic entry point and health check
This commit is contained in:
36
src/index.js
Normal file
36
src/index.js
Normal file
@@ -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;
|
||||
Reference in New Issue
Block a user