मुख्य सामग्री पर जाएं
प्रोजेक्ट टेम्पलेट·Pro

Express + SQLite टास्क API

Express 5 पर टास्क API, जिसमें फ़िल्टर, पेजिंग और टेस्ट हैं। डेटा node:sqlite में जाता है, इसलिए कुछ भी नेटिव कंपाइल नहीं करना पड़ता। Node.js 22.13 या नए वाला Linux एनवायरनमेंट चाहिए; npm install लगभग 3.5 MB डाउनलोड करता है।

इसे इंस्टॉल करने के लिए PocketCode Pro चाहिए।

अगर आपके Android डिवाइस पर PocketCode इंस्टॉल है, तो यह पेज ऐप में खुलेगा।

प्रीव्यू

फ़ाइलें

README.md
package-lock.json
package.json
server.js
src/app.js
src/db.js
src/errors.js
src/routes/tasks.js
src/validate.js
test/tasks.test.js

README.md

# Tasks API: Express + SQLite A REST API for tasks with Express 5 and SQLite: create, list, read, update and delete tasks, filter the list by state, tag or text, and page through it. Input is checked and errors come back as JSON. The database is `node:sqlite`, which is built into Node.js 22.13 and newer, so the only package is Express (about 65 small packages, 3.5 MB, all JavaScript). Comes with tests. ## Run it in PocketCode You need the app's Linux environment with Node.js 22.13 or newer and npm (the Developer pack in Terminal › Linux includes both). Check with `node --version`. 1. Open the terminal in this project's folder (Open Terminal Here, in the editor menu). 2. Install Express (needs internet the first time): ```sh npm install ``` 3. Start the server: ```sh npm start ``` The terminal shows `Tasks API on http://localhost:3000`. `npm run dev` does the same and restarts it when you save a file. Some Node.js versions also print `ExperimentalWarning: SQLite is an experimental feature`; the API works the same. 4. Open http://localhost:3000 in the DevBrowser (or in the phone's browser) to see the list of endpoints. To try the API, open a second terminal tab: ```sh curl -X POST localhost:3000/api/tasks -H 'content-type: application/json' -d '{"title":"Buy milk","tag":"home"}' curl 'localhost:3000/api/tasks?done=false' curl -X PATCH localhost:3000/api/tasks/1 -H 'content-type: application/json' -d '{"done":true}' ```

यह प्रीव्यू छोटा किया गया है। पूरा कंटेंट इंस्टॉल करने पर मिलेगा।

1.0.0 में बदलाव

पहला संस्करण।

संबंधित

बिना डिपेंडेंसी का Node.js JSON APIProप्रोजेक्ट टेम्पलेटnode:http पर नोट्स API: बनाना, सूची, बदलना और हटाना, इनपुट जाँच और JSON एरर के साथ, डेटा एक फ़ाइल में सेव होता है। कुछ इंस्टॉल नहीं करना: server.js पर Run टैप करें, ऐप का अपना Node.js इसे localhost:3000 पर चालू कर देगा। टेस्ट भी शामिल हैं।Markdown स्टैटिक साइटProप्रोजेक्ट टेम्पलेटपेज Markdown में लिखें और उन्हें एक ही लेआउट और मेन्यू वाली स्टैटिक HTML साइट में बदलें। बिल्ड लगभग 110 लाइन का Node.js है जिसे आप बदल सकते हैं, और अकेला पैकेज marked है। नतीजा DevBrowser में खोलें। पहले npm install के लिए Linux एनवायरनमेंट चाहिए।सादे JavaScript में टू-डू लिस्टProप्रोजेक्ट टेम्पलेटसादे JavaScript मॉड्यूल से बनी टू-डू लिस्ट: जोड़ें, वहीं संपादित करें, टिक करें, फ़िल्टर करें और पूरे हुए हटाएँ; सूची localStorage में सेव रहती है। लॉजिक के लिए Node के टेस्ट रनर वाले टेस्ट हैं। DevBrowser और ऐप के अपने Node.js में चलती है, Linux की ज़रूरत नहीं।FastAPI लिंक शॉर्टनरProप्रोजेक्ट टेम्पलेटPython, FastAPI और SQLite में लिंक शॉर्टनर। यह छोटे कोड बनाता है, रीडायरेक्ट करता है और क्लिक गिनता है; साथ में एक पेज का फ़ॉर्म और pytest टेस्ट हैं। Linux एनवायरनमेंट में pip के साथ Python 3.10 या नया चाहिए; यह तय वर्शन वाले 14 पैकेज इंस्टॉल करता है।Flask + SQLite वेब ऐपProप्रोजेक्ट टेम्पलेटFlask में रीडिंग लिस्ट: सर्वर पर बनने वाले पेज और सादे फ़ॉर्म, SQLite में डेटा और एक छोटा JSON API। टेस्ट Flask के टेस्ट क्लाइंट का इस्तेमाल करते हैं। Linux एनवायरनमेंट में Python और pip चाहिए; यह तय वर्ज़न वाले 7 पैकेज इंस्टॉल करता है।SQLite के साथ Python CLIProप्रोजेक्ट टेम्पलेटटर्मिनल के लिए खर्च ट्रैकर: खर्च जोड़ें और देखें, हर महीने श्रेणी के हिसाब से कुल, और CSV एक्सपोर्ट। केवल स्टैंडर्ड लाइब्रेरी (argparse, sqlite3) इस्तेमाल करता है, इसलिए pip से कुछ इंस्टॉल नहीं करना; unittest टेस्ट भी हैं। Linux एनवायरनमेंट में Python चाहिए।