mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-01-21 17:56:13 +01:00
adds express server
This commit is contained in:
parent
037a12a282
commit
92860a1bb4
3 changed files with 2869 additions and 17 deletions
23
server/index.js
Normal file
23
server/index.js
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
const path = require('path');
|
||||
const express = require('express');
|
||||
const app = express();
|
||||
const port = 3050;
|
||||
app.use(express.json());
|
||||
|
||||
const projectPath = path.join(__dirname, '..');
|
||||
app.use(express.static(path.join(projectPath, 'public')));
|
||||
|
||||
app.get('/', function (req, res) {
|
||||
console.log(path.join(projectPath, 'public', 'index.html'));
|
||||
res.sendFile(path.join(projectPath, 'public', 'index.html'));
|
||||
});
|
||||
|
||||
app.post('/ask', (req, res) => {
|
||||
// Here, you can add the logic to process the user's query
|
||||
// and generate a response, which you can then send back
|
||||
// in the response body.
|
||||
});
|
||||
|
||||
app.listen(port, () => {
|
||||
console.log(`Server listening at http://localhost:${port}`);
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue