Skip to content

Instantly share code, notes, and snippets.

View sudipt1999's full-sized avatar
🥇
Code speaks

sudipt dabral sudipt1999

🥇
Code speaks
View GitHub Profile
/**
* Route : '/api/delete/:bookid`
* Description : "Will be data data using bookid"
*/
app.delete('/api/delete/:bookid', (req, res) => {
const id = req.params.bookid
delete data.id
/**
* Route : '/api/update/:bookid`
* Description : "Will be updating data using bookid"
*/
app.post('/api/update/:bookid', (req, res) => {
const id = req.params.bookid
const {name, author, pages, price} = req.body
data[id] = {id, name, author, pages, price}
/**
* Route : '/api/:bookid`
* Description : "Will be fetching data using bookid"
*/
app.get('/api/:bookid', (req, res) => {
const id = req.params.bookid
res.json(data[id])
})
/**
* Route : '/api/add`
* Description : "Will be adding the book to our database"
*/
app.post('/api/add', (req, res) => {
// destruturing the variables, saves times always
const {id, name, author, pages, price} = req.body
// storing the data in the database (here to the variable)
const express = require('express')
const bodyParser = require('body-parser')
const data = require('./data')
const app = express()
// Will allow data from ajax in req.body variable
app.use(bodyParser.json())
const express = require('express')
const bodyParser = require('body-parser')
const data = require('./data')
const data = {}
module.exports = data
Worker information
0.13s0.01s0.00s0.01s
system_info
Build system information
0.00s0.00s0.02s0.00s0.01s0.29s0.00s0.00s0.00s0.01s0.00s0.10s0.01s0.72s0.00s0.00s6.03s0.00s2.42s0.00s
remote: Total 1020 (delta 601), reused 847 (delta 435), pack-reused 0
Receiving objects: 100% (1020/1020) Receiving objects: 100% (1020/1020), 2.86 MiB | 8.09 MiB/s, done.
Resolving deltas: 100% (601/601), done.
$ cd sudipt1999/hydra-python-agent-gui
$ git checkout -qf ff12d52f8da23a5f680a2d7c3d771a4da5cff5a4
(venv) sudipt@sudo-dev:~/Desktop/hydra-python-agent$ python setup.py install
Traceback (most recent call last):
File "setup.py", line 8, in <module>
from pip._internal.download import PipSession
ModuleNotFoundError: No module named 'pip._internal.download'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "setup.py", line 10, in <module>
(venv) sudipt@sudo-dev:~/Desktop/hydra-python-agent$ python setup.py install
Traceback (most recent call last):
File "setup.py", line 8, in <module>
from pip._internal.download import PipSession
ModuleNotFoundError: No module named 'pip._internal.download'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "setup.py", line 10, in <module>