app.post("/register", urlencodedParser, async(req, res, next) => {
req.locals = {
name: req.body.username,
email: req.body.email,
password: req.body.password
}
// ...
app.post('/email-verification', async(req, res) => {
if (req.body.code === code) {
const post = {
name: req.body.name,
email: req.body.email,
password: req.body.password
app.post("/register", urlencodedParser, async(req, res, next) => {
// Создаете объект до ветвлений if, назвать можно как угодно
req.locals = {};
...
});
networks defines the networks that service containers are attached to, referencing entries under the top-level networks key.
export const fetchAllProducts = async (categoryId, brandId, page, limit= 5) => {
const {data} = await guestInstance.get('/product', {params: {
categoryId, brandId, page, limit
}})
console.log(data);
return data
}
export const fetchAllProducts = async (categoryId, brandId, page, limit= 5) => {
const {data} = await guestInstance.get('/product', {
categoryId, brandId, page, limit
})
console.log(data);
return data
}
export const fetchBrands = async () => {
const {data} = await guestInstance.get('brand/')
console.log(data);
return data
}
"devDependencies": {
"@types/node": "^17.0.23",
"tslint": "^6.1.3",
"typescript": "^4.6.3"
}