mirror of
https://github.com/tiennm99/app-store-scraper-api.git
synced 2026-08-04 16:24:27 +00:00
chore: init
This commit is contained in:
+29
@@ -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
|
||||
@@ -1,2 +1,9 @@
|
||||
# app-store-scraper-worker
|
||||
Host [app-store-scraper](https://github.com/facundoolano/app-store-scraper) on [Cloudflare Workers](https://workers.cloudflare.com)
|
||||
# miti-app-store-scraper
|
||||
|
||||
Host [app-store-scraper](https://github.com/facundoolano/app-store-scraper) on [Vercel](https://vercel.com)
|
||||
|
||||
## Usage
|
||||
|
||||
POST requests to `/:method` with raw JSON body parameters.
|
||||
|
||||
See [app-store-scraper documentation](https://github.com/facundoolano/app-store-scraper) for method parameters.
|
||||
|
||||
Generated
+1824
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"name": "miti-app-store-scraper",
|
||||
"type": "module",
|
||||
"dependencies": {
|
||||
"express": "5.1.0",
|
||||
"app-store-scraper": "0.18.0"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
import express from 'express';
|
||||
import store from 'app-store-scraper';
|
||||
|
||||
const app = express();
|
||||
|
||||
app.use(express.json({ limit: '10mb' }));
|
||||
|
||||
app.post('/:method', async (req, res) => {
|
||||
try {
|
||||
const method = req.params.method;
|
||||
const params = req.body;
|
||||
|
||||
if (!store[method]) {
|
||||
return res.status(400).json({
|
||||
error: `Method '${method}' not supported`
|
||||
});
|
||||
}
|
||||
|
||||
const result = await store[method](params);
|
||||
|
||||
res.json(result);
|
||||
} catch (error) {
|
||||
res.status(500).json({ error: error.message });
|
||||
}
|
||||
});
|
||||
|
||||
app.get('/', (req, res) => {
|
||||
res.json({
|
||||
message: 'App Store Scraper',
|
||||
documentation: 'https://github.com/facundoolano/app-store-scraper'
|
||||
});
|
||||
});
|
||||
|
||||
export default app;
|
||||
Reference in New Issue
Block a user