Skip to content

Commit

Permalink
files added
Browse files Browse the repository at this point in the history
  • Loading branch information
Joelisking committed Mar 13, 2024
0 parents commit 69d1ca9
Show file tree
Hide file tree
Showing 962 changed files with 127,403 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 { default: 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': '1063d71d-2735-4258-9b37-4099f86ccc91' } }
);
return res.status(r.status).json(r.data);
} catch (error) {
return res.status(e.response.status).json(e.response.data);
}
});

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/nopt

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 69d1ca9

Please sign in to comment.