Getting Started with Sails JS(Installation + overview)
Sails JS is a MVC framework for node JS built on top of Node and express JS. It provides allows you to quickly get started with the REST API’s.
Lets get step up a sails js project quickly to get you familiar with the framework.
STEP 1:
Open up your favourite Terminal/command Prompt. I am using visual studio on ubuntu 20.04
STEP 2:
Go to your preferred location, here I will choose Desktop/medium
cd Desktopmkdir mediumcd medium
Make sure you have npm and node globally installed, if not first install these two. Check node and npm version
node -v
v14.16.0(yours may be different) any version above 10+ is fine
npm -v
7.7.5(again yours may be different)
STEP 3:
Lets now install Sails JS globally
npm install sails -g
Check sails version
sails -v
I have sails version — 1.4.2
We have now successfully installed sails on the system, lets start with the real work.
STEP 4:
Generate an empty sails project
sails new test-project
STEP 5:
cd test-project
STEP 6:
Lift the project
sails lift
Note: You can alternatively use nodemon to run the app if you have nodemon globally installed
nodemon run start
STEP 7:
Lets open Localhost and see if everything is working fine, by default sails server is runs on PORT 1337
Open your browser and type
localhost:1337
If you see this page voila ! You have successfully started a sails js app.
Thanks :)