index : pan-zoom | |
SVG pan/zoom library. |
aboutsummaryrefslogtreecommitdiff |
diff options
author | Catalin Mititiuc <webdevcat@proton.me> | 2025-03-06 15:27:27 -0800 |
---|---|---|
committer | Catalin Mititiuc <webdevcat@proton.me> | 2025-03-06 21:47:00 -0800 |
commit | f0b5c1a511ba794609178e5f08e7c8f8c2ec1723 (patch) | |
tree | 3f8f2801b7ae20dd41923c24861779cca994b664 /server.js | |
parent | c0b2d77d14b0fd998a36f647c918778030c35623 (diff) |
Diffstat (limited to 'server.js')
-rw-r--r-- | server.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/server.js b/server.js new file mode 100644 index 0000000..4065566 --- /dev/null +++ b/server.js @@ -0,0 +1,27 @@ +const { createServer } = require('esbuild-server'); + +//https://esbuild.github.io/api/#build +const buildOptions = { + bundle: true, + entryPoints: ['src/app.js'], +}; + +//https://github.com/oblador/esbuild-server?tab=readme-ov-file#serveroptions +const serverOptions = { + static: 'public', +}; + +const env = process.env.NODE_ENV === 'test' ? 'Test' : 'Development'; +const server = createServer(buildOptions, serverOptions); +const buildStart = Date.now(); + +server + .start() + .then(() => { + console.log(`Build completed in ${Date.now() - buildStart}ms`); + }) + .catch(() => { + console.error('Build failed'); + }); + +console.log(`${env} server running at ${server.url}`); |