better server build
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import express from 'express';
|
||||
import { handler } from './build/handler.js';
|
||||
import { join } from 'desm';
|
||||
|
||||
const assetsPath = join(import.meta.url, 'uploads');
|
||||
|
||||
const app = express();
|
||||
|
||||
// Serve static files dynamically from the "static" folder (e.g., for uploads)
|
||||
app.use('/uploads', express.static(assetsPath));
|
||||
|
||||
// Serve the built SvelteKit app
|
||||
app.use(handler);
|
||||
|
||||
// Start the server
|
||||
app.listen(8080, () => {
|
||||
console.log('Server running on port 8080');
|
||||
});
|
||||
Reference in New Issue
Block a user