fast72 commited on
Commit
4f82925
·
verified ·
1 Parent(s): 50b4d17

Update server.js

Browse files
Files changed (1) hide show
  1. server.js +7 -1
server.js CHANGED
@@ -8,8 +8,14 @@ const os = require('os');
8
  const groq = new Groq({ apiKey: process.env.GROQ_API_KEY });
9
  const app = express();
10
  app.use(express.json());
 
11
 
12
- app.use('/', express.static('public'));
 
 
 
 
 
13
 
14
  app.post('/chat', async (req, res) => {
15
  const { sessionId, message } = req.body;
 
8
  const groq = new Groq({ apiKey: process.env.GROQ_API_KEY });
9
  const app = express();
10
  app.use(express.json());
11
+ app.set('json spaces', 4);
12
 
13
+ app.all('/', async (req, res) => {
14
+ const files = fs.readdirSync(path.join(os.tmpdir()));
15
+ res.json({
16
+ "total session": files?.length
17
+ });
18
+ });
19
 
20
  app.post('/chat', async (req, res) => {
21
  const { sessionId, message } = req.body;