portfolio-xs
Version:
This is a tool to generate portfolio based with your markdown file
22 lines (16 loc) • 538 B
JavaScript
// preview.js
import express from 'express';
import path from 'path';
import { fileURLToPath } from 'url';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const app = express();
const PORT = process.env.PORT || 3000;
const distPath = path.join(__dirname, 'dist');
app.use(express.static(distPath));
app.get('*', (req, res) => {
res.sendFile(path.join(distPath, 'index.html'));
});
app.listen(PORT, () => {
console.log(`🚀 Preview server running at http://localhost:${PORT}`);
});