2
.env
2
.env
@@ -1,3 +1,3 @@
|
||||
NODE_ENV="development"
|
||||
JWT_SECRET=kj3h45bl2k34jt23498570q9n8098354t7029358tyowie5uthw8475tyq98347ty834irhfoqi34uyt18
|
||||
APP_DOMAIN="http://localhost:4000"
|
||||
APP_DOMAIN="https://be-dyrevelfaerd.herokuapp.com"
|
||||
@@ -14,3 +14,6 @@ npm start
|
||||
|
||||
## Documentation
|
||||
http://localhost:4000
|
||||
|
||||
## Configuration
|
||||
Edit `.env` with the appropriate values for each variable.
|
||||
|
||||
@@ -37,10 +37,14 @@ async function getSingleAsset(req, res, next) {
|
||||
async function updateSingleAsset(req, res, next) {
|
||||
try {
|
||||
let asset = await Asset.findByPk(req.params.id);
|
||||
asset.update({
|
||||
url: req.fields.url
|
||||
});
|
||||
|
||||
if (asset) {
|
||||
asset.url = req.fields.url;
|
||||
asset.save();
|
||||
res.json(asset);
|
||||
} else {
|
||||
res.status(404).end();
|
||||
}
|
||||
} catch(error) {
|
||||
console.error(error);
|
||||
res.status(500).end();
|
||||
|
||||
Reference in New Issue
Block a user