Skip to content

Instantly share code, notes, and snippets.

@ianjennings
Created June 27, 2020 17:11
Show Gist options
  • Save ianjennings/e2700a2305775935ff9df3854eaff301 to your computer and use it in GitHub Desktop.
Save ianjennings/e2700a2305775935ff9df3854eaff301 to your computer and use it in GitHub Desktop.

These routes have been overwritten. So true allows us in. And so why don't we allow ourselves into the Hello world round? So we'll just type What is this path thing? It just Hello, world.

01:56

Let's do true.

01:58

Commit be3c207d66f80bf886eccf8db5140dfb251e2d2b
--- config/policies.js
+++ config/policies.js
@@ -22,4 +22,6 @@ module.exports.policies = {
   'legal/view-privacy': true,
   'deliver-contact-form-message': true,
 
+  'hello-world': true
+
 };

01:59

chrome.exe > NEW_APP_NAME - Google Chrome

02:00

Now I'm going to look up. How to dio sales Watch because I forget

02:09

Forever destined. You start. Okay, So we're going, Tio.

02:09

Then open chrome:

Google Chrome

02:17

And that should allow us to refresh the page. Now when we go to Hello, world this time

02:19

chrome.exe > NEW_APP_NAME - Google Chrome

02:29

We still have to log again. That's funny. Um

02:29

Code.exe > policies.js - paircast-sails - Visual Studio Code

02:33

You know why? Because it's called view. Hello, world, So I made a mistake here. And this is actually, um

02:38

Commit 531c1891117bd22a4a2e3940f64661b05f750b89
--- config/policies.js
+++ config/policies.js
@@ -22,6 +22,6 @@ module.exports.policies = {
   'legal/view-privacy': true,
   'deliver-contact-form-message': true,
 
-  'hello-world': true
+  'view-hello-world': true
 
 };

02:41

The name of the controller and not the route. Right? So the reason is we don't wanna have to update the route's every time we have a policy. So these strings here represent the controller. So now we have a sales are the reloading. We should be able to go to. Hello, world down. Get that.

02:58

Get through into our page. Okay, So here we are.

02:59

Paircast.exe > Paircast

chrome.exe > NEW_APP_NAME - Google Chrome

03:00

We're on our page and let's see what this is made up of. So if we open up the sources and we go to network

03:10

Well refresh the page.

03:12

Ah, we don't We want to see OK, we can see all of these. But sales has this great thing. So if we search for Hello, world we can see that both e. Hello, World. Paige, we're on has been generated as well as

03:25

This Paracels

03:28

Paracels is actually a

03:31

Kind of a modified ofyou. J s. I'll get into it a little bit, but we can see these things have been generated for us already. If we also do a project search

03:39

Code.exe > policies.js - paircast-sails - Visual Studio Code

03:40

Um, let's see if we can look for Hello world and we can see that again. There's a template a less file a page and controller. So the controller here we are.

03:49

Code.exe > view-hello-world.js - paircast-sails - Visual Studio Code

03:51

It's instructing us to load that template. So that's how we know about the template. Let's go to that.

03:56

Um Hello, world e Js we conceive use pages. Hello, world that we go there. This is our template that involved that.

04:04

So if we remove this

04:07

Type. Hello, world and refresh over here. We can see that that's been updated, and, um

04:08

Commit 2d114fa99c536671fc3df1638553da12d50038f5
--- views/pages/hello-world.ejs
+++ views/pages/hello-world.ejs
@@ -1,7 +1,8 @@
 <div id="hello-world" v-cloak>
 
-  <h1>TODO: Implement this page.</h1>
-  <p>(See also <em>assets/styles/pages/hello-world.less</em>, <em>assets/js/pages/hello-world.page.js</em>, and <em>api/controllers/view-hello-world.js</em>.)</p>
+  <h1>Hello World!</h1>
+  <p>(See also <em>assets/styles/pages/hello-world.less</em>, <em>assets/js/pages/hello-world.page.js</em>, and
+    <em>api/controllers/view-hello-world.js</em>.)</p>
 
 </div>
 <%- /* Expose server-rendered data as window.SAILS_LOCALS :: */ exposeLocalsToBrowser() %>

04:09

chrome.exe > NEW_APP_NAME - Google Chrome

04:16

We will see as well how the less work So ah!

04:21

Say we want to modify some kind of CSS on here.

04:27

Well, the whole page has been given the idea. Hello, world.

04:29

Code.exe > hello-world.ejs - paircast-sails - Visual Studio Code

04:30

And we can actually open up.

04:35

Sing.

04:37

Less file for this page. So it's underwear we Hello, world that less

04:42

And it's given us this index already. So if we modify this file

04:47

We'll be affecting the style's only on this page. This follows included. They're imported out less.

04:49

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment