diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7a41a61 --- /dev/null +++ b/.gitignore @@ -0,0 +1,29 @@ +# dev +.yarn/ +!.yarn/releases +.vscode/* +!.vscode/launch.json +!.vscode/*.code-snippets +.idea/workspace.xml +.idea/usage.statistics.xml +.idea/shelf + +# deps +node_modules/ + +# env +.env +.env.production + +# logs +logs/ +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +# misc +.DS_Store +.vercel diff --git a/README.md b/README.md index 8284398..e319b42 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,27 @@ -# google-play-scraper-worker -Host [google-play-scraper](https://github.com/facundoolano/google-play-scraper) on [Cloudflare Workers](https://workers.cloudflare.com) +# google-play-scraper +Host [google-play-scraper](https://github.com/facundoolano/google-play-scraper) on [Vercel](https://vercel.com) + +To develop locally: + +``` +npm install +vc dev +``` + +``` +open http://localhost:3000 +``` + +To build locally: + +``` +npm install +vc build +``` + +To deploy: + +``` +npm install +vc deploy +``` diff --git a/package.json b/package.json new file mode 100644 index 0000000..a8d75e7 --- /dev/null +++ b/package.json @@ -0,0 +1,12 @@ +{ + "name": "express", + "type": "module", + "dependencies": { + "express": "5.1.0" + }, + "devDependencies": { + "@types/node": "20.11.17", + "@types/express": "5.0.0", + "typescript": "5.8.3" + } +} diff --git a/src/index.ts b/src/index.ts new file mode 100644 index 0000000..7e80eb8 --- /dev/null +++ b/src/index.ts @@ -0,0 +1,17 @@ +import express from 'express' + +const app = express() + +app.get('/', (_req, res) => { + res.send('Hello Express!') +}) + +app.get('/api/users/:id', (_req, res) => { + res.json({ id: _req.params.id }) +}) + +app.get('/api/posts/:postId/comments/:commentId', (_req, res) => { + res.json({ postId: _req.params.postId, commentId: _req.params.commentId }) +}) + +export default app diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..5b59248 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,8 @@ +{ + "compilerOptions": { + "target": "ESNext", + "module": "NodeNext", + "skipLibCheck": true, + }, + "exclude": ["node_modules"] +}