Strapi watchIgnoreFiles - strapi

My server always restarting when I edit an file in my project but I want to exclude the logs directory.
I've tried to use watchIgnoreFiles in my server.js but it doesn't work.
Can you help me thanks
folders tree
server.js

Related

Laravel git ignoring images uploaded to storage

I'm running into an issue which i haven't been able to solve yet.
I was working on a laravel project and than moved this project folder to a newer version of MAMP. So far so good, everything was working fine. I just copied all the folders and files and all was good until i logged in to my laravel application on localhost and uploaded some images.
I know i can do this on my host but i like to work on localhost to add content and than push it to my prod env. Anyway, after i uploaded some images and did a git add . and commit it didnt add my uploaded images, on phpstorm they also turn out red in the storage/app/public/images folder.
On my previous mamp version everything used to work fine.
Stuff I have already tried:
I tried deleting the symlink storage folder and make a new link, didn't help.
I tried deleting the storage folder from gitignore, also didn't help.
My gitignore file looks like this:
/node_modules
/vendor
/public/hot
/public/storage
/storage/*.key
.env
.env.backup
.phpunit.result.cache
Homestead.json
Homestead.yaml
npm-debug.log
yarn-error.log
/config/database.php
/public/sitemap.xml
When i login on my prod env and i upload images, they turn up fine, but i prefer sometimes to work from localhost to write content and push it to env.
I have also tried to:
git check-ignore -v -- path/to/file
To check why the file (image) is being ignored but it doesnt return anything.
I got one time a message with: Fatal: pathspec ... is beyond a symbolic link.
I hope someone can push me into the right direction. Thank you.

Changes in the vue file not applying in the browser

I am working in project having technology(laravel + vuejs).In that there is a form created in vue file and i want to add a text in the vue file.So as i have seen that "when any changes is done in vue file then need to rebuild the application".And i see that there are commands for rebuild the application is npm run dev , npm run prod , npm run watch and npm run watch-poll. I have tried all this commands after saving the file through FTP but sometimes the changes is applied (Note : Not immediately but after some duration) and sometimes no changes apply in the browser.When i tried the above command by executing it then there is no such error occurs and the rebuild is done successfully.So what will be the issue can you please suggest something that i need to configure?
Below is the code of package.json,webpack.mix.js file and after that i have attached image of putty in which application rebuild is done.
Thanks in advance!
I think you are not understanding what npm run dev/prod/watch do. If you alter the .vue file in your resources folder, then have npm rebuild your assets, then ftp the vue file to your server, nothing should happen.
Depending on how you have your laravel mix file set-up, the file you need to ftp to the server is likely public/js/app.js.
You should really consider getting your local environment setup for development, there is nothing I can image worse than viewing your changes by ftp-ing files to a server.

Deploying Strapi to Heroku

I've been following the official Strapi tutorials on how to develop and deploy an application to Heroku and it seems you have to configure some files like ./config/environments/**/database.json.
The problem is that, installing the app without --quickstart (yarn create strapi-app my-project), my config folder just has a functions folder and database.js and server.js files.
Should I create manually this database.json or is this supposed to be created automatically when initializing the app without --quickstart?
I was also confused so I manually created the folders /environments/production and inside the file database.json and it worked for me.
Link to the docs: https://strapi.io/documentation/3.0.0-beta.x/deployment/heroku.html#_4-update-your-database-config-file

Publishing a web site: from a directory tree to server

Does anyone know of a script to publish a web site directory hierarchy to a web server from a local git repo? I'm trying to avoid re-inventing the wheel.
I was thinking the solution could either be scripted visiting file by file or a directory tree using rsync. If scripted file by file, a configuration file would contain tuples; each file to be published and its permissions. This configuration file may also contain path names for folders to be created as well.
Appreciate your guidance.
The solution was to use rsync and ssh with the chmod command to edit permission after syncing the directories.

How to host a simple index.html with some javascript and css on Heroku?

I'm trying to deploy an application through Heroku which is just an index.html page with some javascript and css.
I've connected my Github repository to it as a deployment method, but it never seems to work.
Every time I type "heroku logs", it spits back out:
"npm ERR! missing script: start" first.
From what I've searched, it tells me that I need to add "start": "somefile.js" as a starting point in package.json, but this is a very simple index.html page with javascript invoked from whenever a couple buttons are pressed.
How am I meant to get past this?
Heroku isn't really built for hosting static websites that have no dynamic server backend. If you want to do that, you should look into using a proper static file host like Amazon S3, Netlify, etc.
However -- if you DO want to do this on Heroku, you can do so by creating a really simple application (here's an article which shows you how to do it using Ruby): https://devcenter.heroku.com/articles/static-sites-ruby
Agree with #rdegges, you need some sort of http server. A basic node http server is pretty trivial to implement as well.
A full tutorial is available, but the keys steps are:
Make sure you have [node, npm, heroku CLI] installed.
In the root of your project directory, run npm init - (this will create a package.json in your root project directory)
Run npm install --save express - (this will add express as a dependency to the package.json file)
Create a file named Procfile in the root directory.
(contents: web: npm app.js)
Create a file named app.js in the root directory. (contents below)
Commit your changes, push to Heroku - git push heroku master
That should do it. Make sure all your files are in a directory called public as specified in the app.js file or change that to reflect where they actually are.
app.js:
var express = require('express');
var app = express();
app.use('/', express.static('public'));
app.listen(process.env.PORT || 8080);
Full Tutorial: https://devcenter.heroku.com/articles/getting-started-with-nodejs#introduction

Resources