1.This is my productController:
const Product = require('../models/product')
//Create new product => /ap1/v1/product/new
exports.newProduct = async(req, res, next) => {
const product = await Product.create(req.body);
res.status(201).json({
success: true,
product:
})
}
exports.getProducts = (req, res, next) => {
res.status(200).json({
success: true,
message: 'This route will show all produts in database.'
})
}
- This is my package.json file
{
"name": "shopit",
"version": "1.0.0",
"description": "e-commerce using MERN",
"main": "server.js",
"scripts": {
"start": "node backend/server.js",
"dev": "SET NODE_ENV=DEVELOPMENT& nodemon backend/server",
"prod": "nodemon ./server.js localhost 8080: "
},
"author": "Floyd",
"license": "ISC",
"dependencies": {
"dotenv": "^8.2.0",
"express": "^4.17.1",
"mongoose": "^5.11.13"
},
"devDependencies": {
"nodemon": "^2.0.7"
}
}
- This is my server.js file
const app = require('./app');
const connectDatabase = require('./config/database')
const dotenv = require('dotenv');
//Setting up config files
dotenv.config({ path: 'backend/config/config.env' })
//Connecting to database
connectDatabase();
app.listen(process.env.PORT, () => {
console.log(`Server started on PORT: ${process.env.PORT} in ${process.env.NODE_ENV}
mode.`)
});
- This is my routes file
const express = require('express');
const router = express.Router();
const { getProducts, newProduct } = require('../controllers/productController');
router.route('/products').get(getProducts);
router.route('/product/new').post(newProduct);
module.exports = router;
This is my error:
D:\PROGRAMMING\2077\SHOPIT\backend\controllers\productController.js:12
})
^
SyntaxError: Unexpected token '}'
at wrapSafe (internal/modules/cjs/loader.js:979:16)
at Module._compile (internal/modules/cjs/loader.js:1027:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.<anonymous> (D:\PROGRAMMING\2077\SHOPIT\backend\routes\product.js:4:37)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
[nodemon] app crashed - waiting for file changes before starting...
prednisone from india – buy prednisone 10mg online prednisone 40 mg
https://kamagraday.com/ how to take sildenafil 20 mg
https://cialisbob.com/ tadalafil
modafinil and caffeine – generic modafinil provigil a stimulant
roche accutane – accutane uk prescription can you buy accutane over the counter in canada
https://wardenafil.com sildenafil levitra
amoxil 500 – walgreens amoxicillin price buy amoxicilina 500 mg online
http://levitradd.com/ what is levitra used for
what is vardenafil – buy levitra vardenafil online us
http://levitradd.com/ levitra on sale
https://himscanada.com/ cialis online catalog
ivermectin 4 mg – buy stromectol 12mg ivermectin 2mg online
reputable indian online pharmacy – cialis south africa price cialis no rx
ivermectin over the counter – ivermectin 24 mg
accutane cream online – canadian pharmacy online accutane buy accutane online canada pharmacy
lyrica 750 mg – lyrica 50 mg price in india canadian pharmacy generic levitra
amoxicillin for humans for sale – amoxil USA generic amoxicillin cost
online sildenafil – where can you buy viagra buy viagra prescription
http://fildenahim.com another product like fildena
cialis super active 20mg – cialis usa pharmacy cialis online us
ivermectin 3mg online – stromectol price buy oral ivermectin
http://stromectolhumans.com/ ivermectin for humans
prednisone 5084 – order prednisone without prescription fast shipping prednisone 8 mg
http://iwermectin.com/ ivermectin for humans amazon
https://viagraxyu.com viagra online
provigil for adhd – provigil settlement provigil generic
furosemide 80 mg daily – furosemide 200 mg lasix 100mg online
buy clomid 25mg online – clomid warnings clomid pregnancy
buy viagra in australia – sildenafil 100mg price canada buy generic viagra soft tabs
http://ivermectineffects.com/ stromectol ivermectin
http://ivermectinovercounter.com/ ivermectin for humans
https://ivermectineffects.com topical ivermectin for humans over the counter
health insurance for expats asthma joke
ivermectin pills for humans https://ivermectinhome.com
https://ivermectinus.com/ ivermectin 3 mg for humans
http://zithrozpack.com/ zithromax antibiotic
levitra generic drug https://levitrair.com viagra or levitra
why does obese cause heart disease inexpensive health care plans
ivermectin https://ivermectinhome.com
https://albuterolotc.com/ albuterol from mexico
when did magic johnson find out he had hiv change healthcare plan
stromectol an effective replacement for ivermectin https://ivermectinhome.com
ivermectin tablets dosage https://stromectolus.com ivermectin
ivermectin over the counter http://ivermcov.com/# stromectol
mecklenburg county health department how can you get to the root of your blood pressure problem
stromectol cost https://ivermectinhome.com
javascript-help.li recommended common over the counter medications https://pharmvolk.com lowest prices for prescription drugs
why is healthcare a right http://ventolinhfaer.com/ proventil inhaler coupon
what happens to male cats hiv positive holistic medicine for rheumatoid arthritis
ivermectin tablets dosage https://ivermectinhome.com
javascript-help.li reviewed purchasing ivermectin for humans http://ivermectini.com ivermectin paste
where to file a complaint against a health insurance company stromectol ivermectin http://iveramectin.com ivermectin tablets for sale walmart
javascript-help.li vs ivermectin kaufen Г¶sterreich http://ivermectiny.com ivermectin
information of medicine https://dapoxetineus.com/ dapoxetine for sale
javascript-help.li vs ivermectin cream https://ivermectiny.com ivermectin for humans for sale
viagra need prescription http://viagrob.com does viagra raise blood pressure
javascript-help.li reviewed mga tablet na stromectol http://ivermectinhum.com ivermectin over the counter
ivermectin tablets over counter stromectol for humans http://stromectl.com is ivermectin a prescription drug
https://stromectolo.com – doctors who prescribe ivermectin at no cost
ivermectin oral solution https://ivermectin1.com/ ivermectin without doctor prescription
zyrtec sale – http://allergyd.com
new hiv medication http://ivermectinhome.com – stromectol for humans
stromectol 3mg – fda ivermectin ivermectin pills
ivermectin 1 cream 45gm https://stromectolforte.com/# koupit ivermectin nz ivermectin
how much is ivermectin https://ivermecton.com/ ivermectine
prednisone 20mg price in india – prednisone 10 mg tablets prednisone prescription for sale
http://lasixotc.com gas station erectile dysfunction pills
prescription drugs program rules for taking prescription drugs on airplane
buy generic cialis in canada cialis pills
how to report someone selling prescription drugs pharmacy near me
ivermectin 12 mg price ivermectin pour on for dogs
what makes you harder viagra or cialis cialis mexico
price of viagra sildenafil cream
ivermectin https://ivermectinol.com
furosemide pictures long term side effects of furosemide how much furosemide can i give my dog
cheap dissertation help dissertation to book
essay paper writers css forum essay paper 2013
essay rater free download ah geography essay
master of science thesis sample thesis statement for mary shelley’s frankenstein
order plaquenil 200mg pill – buy generic hydroxychloroquine 400mg buy valacyclovir 1000mg generic
brand sildalis – sildalis sale order metformin for sale
order ampicillin 250mg generic – cipro pills plaquenil online
cheap sildenafil for sale – pfizer viagra 50mg buy tadalafil 20mg for sale
viagra 200mg pour homme – sildenafil 25mg pas cher acheter 20mg tadalafil en ligne
prednisone pill – cheapest ed pills online purchase prednisone generic
order isotretinoin 10mg sale – buy glucophage 500mg pills oral amoxil 250mg
buy lyrica 75mg online – order furosemide online cheap order zithromax 250mg online
buy cenforce without prescription – cenforce online cheap acyclovir 800mg
buy tizanidine 2mg online cheap – buy prozac 20mg gloperba without prescription
effects of viagra viagra generic
tadalafil 20 mg cialis reviews
cialis daily buy cialis without prescription