Loading
Lesson 04
Courses / Quick Start Introduction to Sails
Lifting the Sails App

Video Transcript

In this lecture we're going to learn how to start up a sales app. So we already have this sales app, SalesQuickStart, that was generated using SalesNew, SalesQuickStart, remember? So the entry point for the app is this file called app.js. So you can simply say, nodeapp.js to lift the sales server. Okay, so the sales server was lifted. In sales they like to say lift, to mean it started. So the server was lifted in the development environment with the part 1337. It's like lead part anyway. So now that the server is running, you can just go to localhost, localhost 1337. And you're going to see this started page here. You're looking at views slash homepage.ejs. So this whole thing here is the layout.ejs and then they injected the views slash homepage.ejs. So it tells you how to generate a REST API and all that stuff that we are going to do. Okay? Now there are other ways to lift the sales server. So we did nodeapp.js, but if you look at the package.json, there's already that script that calls nodeapp.js. If you notice, go to package.json and notice there's under scripts, there's the start script that does exactly what we did. So you can also say npm start and that will call upon nodeapp.js. All right? To start. So that's yet another way to, that's another way to lift the sales server. Okay? Now I can kill the server using control C in the terminal. The signal to interrupt. All right? Now, to finalize just with yet another way of lifting the sales server. Some people like calling the sales command sales followed by lift. All right? This way. This also works. Now the preferred way is I prefer calling the npm script. That way it always uses the sales version that was defined in the package.json. So my preferred way will always be this way, npm start. All right? This guy will make sure to use the sales version determined in the package.json because it's already installed in the node modules and it's going to use the correct module instead of the global one. All right? So that's it for this lecture. You now have a sales server running and until the next time, bye.
No comments yet (loading...)
No comments yet (loading...)
Did you like the lesson? 😆👍
Consider a donation to support our work: