Skip to content

Commit

Permalink
Use react-chat-engine-pretty
Browse files Browse the repository at this point in the history
  • Loading branch information
hereskira committed Aug 4, 2024
0 parents commit 97cffd2
Show file tree
Hide file tree
Showing 942 changed files with 127,877 additions and 0 deletions.
24 changes: 24 additions & 0 deletions backend/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
const express = require("express");
const cors = require("cors");
const axios = require('axios');

const app = express();
app.use(express.json());
app.use(cors({ origin: true }));

app.post("/authenticate", async (req, res) => {
const { username } = req.body;
try{
const r = await axios.put(
"https://api.chatengine.io/users/",
{username: username, secret: username, first_name: username},
{headers: {"private-key": "bde6f317-f1fa-4951-9dac-5cde80f76435"}}
)
return res.status(r.status).json(r.data)
} catch (e) {
return res.status(e.response.status).json(e.response.data)
}
return res.json({ username: username, secret: "sha256..." });
});

app.listen(3001);
1 change: 1 addition & 0 deletions backend/node_modules/.bin/mime

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions backend/node_modules/.bin/nodemon

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions backend/node_modules/.bin/nodetouch

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions backend/node_modules/.bin/semver

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 97cffd2

Please sign in to comment.