better server build
This commit is contained in:
parent
5349d60a3c
commit
be7b71fce4
778
package-lock.json
generated
778
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -51,7 +51,9 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"bcrypt": "^6.0.0",
|
||||
"desm": "^1.3.1",
|
||||
"dotenv": "^17.2.3",
|
||||
"express": "^5.2.1",
|
||||
"jsonwebtoken": "^9.0.3",
|
||||
"postgres": "^3.4.7",
|
||||
"svelte-preprocess": "^6.0.3"
|
||||
|
||||
18
server.js
Normal file
18
server.js
Normal file
@ -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');
|
||||
});
|
||||
Loading…
Reference in New Issue
Block a user