This is a remake of LSTS made with sveltekit and using a api that gets data from MongoDB.
Tracks the stock of local pharmacies to help people find their medicine easier
app = Flask(name) app.config['MONGO_URI'] = 'MONGODB_CONNECT_STRING' mongo = PyMongo(app)
@app.route('/api/
result = []
for doc in documents:
result.append({
'_id': str(doc['_id']),
'name': doc['name'],
'quant': doc['quant']
})
return jsonify(result)
except PyMongoError as e:
return str(e), 500
if name == 'main': CORS(app) app.run(host='localhost', port=8888)
- The collection name in your MongoDB database needs to be "remedios" or you can change the code of course.
- This is the standard this particular script is expecting:
```nosql
{
"_id": Integer,
"unit": String,
"name": String,
"quant": Integer
}
:warning: This is a PoC project for educational purposes only: We don't provide any support, use at your own risk!
npm run dev -- --open