-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
42 lines (33 loc) · 1.04 KB
/
server.js
File metadata and controls
42 lines (33 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
const express = require('express');
const path = require('path');
const app = express();
const port = 9000; // You can adjust the port number as needed
// Serve static files from the 'public' directory
app.use(express.static(path.join(__dirname, 'public')));
// Start the server
app.listen(port, () => {
console.log(`Demo app listening at http://localhost:${port}`);
});
/*
const webpack = require('webpack');
const WebpackDevServer = require('webpack-dev-server');
const config = require('../webpack.config.js');
const devConfig = config.find(c => c.mode === 'development');
if (!devConfig) {
throw new Error('Development configuration not found');
}
const compiler = webpack(devConfig);
const server = new WebpackDevServer({
static: {
directory: './public'
},
port: devConfig.devServer.port,
headers: devConfig.devServer.headers,
devMiddleware: {
publicPath: devConfig.devServer.devMiddleware.publicPath,
},
}, compiler);
server.startCallback(() => {
console.log(`Server started on port ${devConfig.devServer.port}`);
});
*/