Skip to content

Instantly share code, notes, and snippets.

@ianjennings
Created June 27, 2020 19:46
Show Gist options
  • Save ianjennings/2ba7a6df9e406f203c086d88de730a70 to your computer and use it in GitHub Desktop.
Save ianjennings/2ba7a6df9e406f203c086d88de730a70 to your computer and use it in GitHub Desktop.

Create a route

Watch me do it here

Okay?

Okay, now that we've found the route

We'll send out a policy.

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

05:33

True.

05:37

We re lift the app.

05:37

Commit af4f6a7082de1817a226ae7aedf264e4059339a8
--- my-app/config/policies.js
+++ my-app/config/policies.js
@@ -12,6 +12,8 @@ module.exports.policies = {
 
   '*': 'is-logged-in',
 
+  'view-hello-world': true,
+
   // Bypass the `is-logged-in` policy for:
   'entrance/*': true,
   'account/logout': true,

05:43

ConEmu64.exe > Cmder

06:09

We re lift the app.

06:15

To go to Hello, world.

06:17

And there's our page.

06:17

Commit 46d8929b8db39b41d95e69b4b4c838d1fdc70b2d
--- my-app/views/layouts/layout.ejs
+++ my-app/views/layouts/layout.ejs
@@ -155,6 +155,7 @@
     <script src="/js/pages/entrance/new-password.page.js"></script>
     <script src="/js/pages/entrance/signup.page.js"></script>
     <script src="/js/pages/faq.page.js"></script>
+    <script src="/js/pages/hello-world.page.js"></script>
     <script src="/js/pages/homepage.page.js"></script>
     <script src="/js/pages/legal/privacy.page.js"></script>
     <script src="/js/pages/legal/terms.page.js"></script>

06:19

Just for fun. Let's edit the styles, so there's another set up. We need to do

06:23

How to set up styles

We need to actually link the styles from the importer file. There's importers that less

06:33

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

06:33

We just need to make sure that we're going to include

06:36

Stiles pages. Hello, world.

06:40

It's already some examples here, so I'm pretty sure we can just type import pages. Hello, world that less on There we go.

06:43

Code.exe > importer.less - paircast-sails - Visual Studio Code

06:48

I know it's important to know that as I'm typing that we're not getting every change. Farecast actually only watches for file saves.

06:50

Commit 2ed9a159c6fa0eb3400b519b62262d919141f66a
--- my-app/assets/styles/importer.less
+++ my-app/assets/styles/importer.less
@@ -31,6 +31,7 @@
 @import 'pages/account/account-overview.less';
 @import 'pages/account/edit-password.less';
 @import 'pages/account/edit-profile.less';
+@import 'pages/hello-world.less';
 @import 'pages/legal/terms.less';
 @import 'pages/legal/privacy.less';
 @import 'pages/faq.less';

06:56

Now let's open up the Hello world less file.

07:01

Okay? And let's just make the background great.

07:07

I refresh the page hear the background of gray.

07:10

Commit 20b4b313d85cccd3bec1a3a625b0901e492a85d8
--- my-app/assets/styles/pages/hello-world.less
+++ my-app/assets/styles/pages/hello-world.less
@@ -1,5 +1,6 @@
 #hello-world {
 
+  background-color: #efefef;
   //…
 
 }

07:11

And I think we'll end editorial here.

07:13

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