|
@@ -1,6 +1,24 @@
|
|
|
+
|
|
|
+const express = require('express');
|
|
|
import { AvatarGenerator } from 'random-avatar-generator';
|
|
|
|
|
|
+const app = express();
|
|
|
+const port = 1854;
|
|
|
+
|
|
|
+app.get('/getRandomLink', (req, res) => {
|
|
|
+ const randomAvatar = generator.generateRandomAvatar();
|
|
|
+ res.json({ avatarLink: randomAvatar });
|
|
|
+});
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
const generator = new AvatarGenerator();
|
|
|
|
|
|
// Simply get a random avatar
|
|
|
generator.generateRandomAvatar();
|
|
|
+
|
|
|
+
|
|
|
+app.listen(port, () => {
|
|
|
+ console.log(`Server running on port ${port}`);
|
|
|
+ });
|
|
|
+
|