Spaces:
Paused
Paused
Download server.js from truegleai/Andrew-dev1.1: direct link, hf CLI and curl.
- Browser
- Download file 597 Bytes
-
https://huggingface.co/spaces/truegleai/Andrew-dev1.1/resolve/main/server.js
- Command line
-
hf download hf://spaces/truegleai/Andrew-dev1.1/server.js
-
curl -L -o server.js https://huggingface.co/spaces/truegleai/Andrew-dev1.1/resolve/main/server.js
597 Bytes
| const express = require('express'); | |
| const next = require('next'); | |
| const dev = process.env.NODE_ENV !== 'production'; | |
| const app = next({ dev }); | |
| const handle = app.getRequestHandler(); | |
| const port = process.env.PORT || 3001; | |
| app.prepare().then(() => { | |
| const server = express(); | |
| // Handle ALL routes and methods (GET, POST, etc.) | |
| server.all('*', (req, res) => { | |
| return handle(req, res); | |
| }); | |
| server.listen(port, (err) => { | |
| if (err) throw err; | |
| console.log(`> Open-View Ready on http://localhost:${port}`); | |
| console.log(`> Access via: http://localhost:${port}`); | |
| }); | |
| }); | |