This commit is contained in:
parent
24e99bb41d
commit
f42e57a3b3
@ -40,17 +40,9 @@ function compileSassProduction(sassFile) {
|
||||
const cssPath = path.join(__dirname, 'public/css/');
|
||||
const fullCssPath = path.join(cssPath, cssFile);
|
||||
|
||||
return compileSass(fullSassPath).then(css => {
|
||||
return new Promise((resolve, reject) => {
|
||||
mkdirp(cssPath, error => {
|
||||
if (error) {
|
||||
return reject(error);
|
||||
}
|
||||
|
||||
resolve();
|
||||
});
|
||||
}).then(() => {
|
||||
return new Promise((resolve, reject) => {
|
||||
return compileSass(fullSassPath).then(css =>
|
||||
mkdirp(cssPath).then(() =>
|
||||
new Promise((resolve, reject) => {
|
||||
fs.writeFile(fullCssPath, css, error => {
|
||||
if (error) {
|
||||
return reject(error);
|
||||
@ -58,9 +50,9 @@ function compileSassProduction(sassFile) {
|
||||
|
||||
resolve(cssFile);
|
||||
});
|
||||
});
|
||||
}).catch(console.error);
|
||||
});
|
||||
})
|
||||
)
|
||||
).catch(console.error);;
|
||||
}
|
||||
|
||||
function compileSassMain() {
|
||||
|
@ -18,6 +18,7 @@
|
||||
"fastify": "latest",
|
||||
"fastify-leveldb": "latest",
|
||||
"fastify-static": "^2.5.0",
|
||||
"mkdirp": "^1.0.4",
|
||||
"node-sass": "^6.0.0"
|
||||
}
|
||||
}
|
||||
|
@ -24,8 +24,7 @@ module.exports = (fastify, opts, done) => {
|
||||
if(req.params.id == undefined){
|
||||
reply.code(400).send({error:"No ID query parameter"});
|
||||
} else {
|
||||
const { level } = fastify
|
||||
level.get(req.params.id, (err, val) => {
|
||||
fastify.level.get(req.params.id, (err, val) => {
|
||||
if(err){
|
||||
console.warn(err);
|
||||
reply.send({name:"New Journey", main:[]});
|
||||
@ -40,8 +39,7 @@ module.exports = (fastify, opts, done) => {
|
||||
if(req.params.id == undefined){
|
||||
reply.code(400).send({error:"No ID query parameter"});
|
||||
} else {
|
||||
const { level } = fastify
|
||||
level.put(req.params.id, JSON.stringify(req.body), (err) => {
|
||||
fastify.level.put(req.params.id, JSON.stringify(req.body), (err) => {
|
||||
if(err){
|
||||
console.warn(err);
|
||||
reply.code(500).send({error:"Error with DB"});
|
||||
@ -56,8 +54,7 @@ module.exports = (fastify, opts, done) => {
|
||||
if(req.params.id == undefined){
|
||||
reply.code(400).send({error:"No ID query parameter"});
|
||||
} else {
|
||||
const { level } = fastify
|
||||
level.delete(req.params.id,(err) => {
|
||||
fastify.level.delete(req.params.id,(err) => {
|
||||
if(err){
|
||||
console.warn(err);
|
||||
reply.code(500).send({error:"Error with DB"});
|
||||
|
Loading…
x
Reference in New Issue
Block a user