-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6ca6d71
commit dc4430b
Showing
5 changed files
with
90 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Prettier | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
prettier: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
|
||
- name: Run npm ci | ||
run: npm ci | ||
|
||
- name: Run Prettier | ||
run: npx prettier --write . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/** | ||
* inertia hook | ||
* | ||
* @description :: A hook definition. Extends Sails by adding shadow routes, implicit actions, and/or initialization logic. | ||
* @docs :: https://sailsjs.com/docs/concepts/extending-sails/hooks | ||
*/ | ||
module.exports = function defineFlashHook(sails) { | ||
return { | ||
initialize: async function () { | ||
if (!sails.hooks.session) { | ||
var err = new Error('`flash` hook requires the `session` hook, but the `session` hook is disabled. Please enable both or neither.'); | ||
err.code = 'E_HOOKINIT_DEP'; | ||
err.name = 'failed requires `session` hook'; | ||
return cb(err); | ||
} | ||
|
||
sails.after('hook:session:loaded', () => { | ||
const flash = require('connect-flash') | ||
sails.hooks.http.app.use(flash()) | ||
}) | ||
|
||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"name": "sails-flash", | ||
"version": "0.0.0", | ||
"description": "Simple session flash messages for Sails applications", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"keywords": [], | ||
"author": "Kelvin Omereshone<kelvin@sailscasts.com", | ||
"license": "MIT", | ||
"sails": { | ||
"isHook": true, | ||
"hookName": "flash" | ||
}, | ||
"dependencies": { | ||
"connect-flash": "^0.1.1" | ||
} | ||
} |