1
Do the following:
- In his
package.json
look up the sectionscripts
Add this line (if any replace)
scripts: { "start": "ionic serve && nodemon server.js" //Outros scripts aqui abaixo }
Ai then at the root of your project simply run npm start
1
2
Do the following:
package.json
look up the section scripts
Add this line (if any replace)
scripts: {
"start": "ionic serve && nodemon server.js"
//Outros scripts aqui abaixo
}
Ai then at the root of your project simply run npm start
Browser other questions tagged ionic mongodb mac
You are not signed in. Login or sign up in order to post.
Hello @khaosdoctor @Ricardo-moraleida! includes the script as suggested. but when I run npm start, first it runs Ionic serves. only after I quit, is the nodemon server.js. left only nodemon server.js , it works too. running only the server.js When running Ionic emulate Ios, the application opens. but when I click on the button that will make the connection with Mongo simply does not work, because it seems that the server.js has not been launched
– Elton A. Pering
Try to use
&
instead of&&
then it will run things in background.– KhaosDoctor
did not work. remembering that I am using IONIC 1
– Elton A. Pering
But are you running npm start? What is the sequence of commands you are running?
– KhaosDoctor
true, I forgot that detail. I now ran npm start. apparently all right. ran the server. didn’t even open the app in Browse. with Ionic emulate opened the app, but did not connect to the database (did not run the server), this is because when running nodemon server.js at the prompt and trying to authenticate, it works.
– Elton A. Pering
But then you have to decide what you want with the command, the command I gave you starts the Ionic serve (if you have the
&
in the background, ai does not open the browser) and starts theserver.js
. If you want other npm script commands, just create other scrips below this and run withnpm run <script>
, for examplenpm run serve
and in jsonserve: 'ionic serve && nodemon server.js'
– KhaosDoctor
I got in the way of asking the question . I rephrased the question. see if you can help me; @Ricardo-moraleida
– Elton A. Pering
Life, so simple. I didn’t know that you need to run this on a Node server like Heroku for example. it is necessary to structure the project so that the server.js (Node) stays on the server :) in case I used the Heroku. hugs
– Elton A. Pering