diff --git a/server/.gitignore b/server/.gitignore deleted file mode 100644 index bbacd7f..0000000 --- a/server/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules -bun.lockb \ No newline at end of file diff --git a/server/index.ts b/server/index.ts deleted file mode 100644 index 4832eaf..0000000 --- a/server/index.ts +++ /dev/null @@ -1,33 +0,0 @@ -import express from 'express'; -import bodyParser from 'body-parser'; -import { minePow } from 'nostr-tools/lib/types/nip13'; - -const app = express(); -const port = 3000; - -// Use body-parser middleware to parse JSON requests -app.use(bodyParser.json()); - -app.post('/powgen', async (req, res) => { - try { - const { unsigned, difficulty } = req.body; - - // Validate input - if (!unsigned || !difficulty) { - return res.status(400).send('Missing unsigned event or difficulty.'); - } - - // Call minePow function to generate PoW - const result = minePow(unsigned, difficulty); - - // Send back the result - res.json(result); - } catch (error) { - console.error('Error generating PoW:', error); - res.status(500).send('Internal server error'); - } -}); - -app.listen(port, () => { - console.log(`Server running at http://localhost:${port}`); -}); diff --git a/server/package.json b/server/package.json deleted file mode 100644 index cc00412..0000000 --- a/server/package.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "server", - "version": "1.0.0", - "description": "", - "main": "index.js", - "scripts": { - "build": "tsc", - "start": "node dist/index.js", - "dev": "tsc && node dist/index.js" - }, - "keywords": [], - "author": "", - "license": "ISC", - "dependencies": { - "@types/express": "^4.17.21", - "@types/node": "^20.9.1", - "express": "^4.18.2", - "nostr-tools": "^1.17.0", - "typescript": "^5.2.2" - } -} diff --git a/server/tsconfig.json b/server/tsconfig.json deleted file mode 100644 index 3ec7a62..0000000 --- a/server/tsconfig.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "compilerOptions": { - "target": "es6", - "module": "commonjs", - "rootDir": "./", - "outDir": "./dist", - "esModuleInterop": true, - "strict": true, - "skipLibCheck": true - }, - "include": ["src/**/*", "index.ts"], - "exclude": ["node_modules"] -}