Skip to content
This repository has been archived by the owner on Aug 13, 2021. It is now read-only.

generated a new sails app v recent #2

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 14 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,43 +1,33 @@
# Sails.js Seed (Sample App)
# seed

A sample [Sails v1](https://sailsjs.com) application, generated with:
a [Sails v1](https://sailsjs.com) application generated with

```
sails new seed --caviar
```


### Links

+ [Get started](https://sailsjs.com/get-started)
+ [Sails framework documentation](https://sailsjs.com/documentation)
+ [Version notes / upgrading](https://sailsjs.com/documentation/upgrading)
+ [Deployment tips](https://sailsjs.com/documentation/concepts/deployment)
+ [Community support options](https://sailsjs.com/support)
+ [Professional / enterprise options](https://sailsjs.com/enterprise)

## Help
If you have questions or run into issues, check out our [recommended community support options](https://sailsjs.com/support).

> The Sails framework is actively maintained by The Sails Company, a full-service [web development studio in Austin, TX](https://sailsjs.com/studio), with the support of our [contributors](https://sailsjs.com/documentation/contributing). We created Sails in 2012 to assist us on Node.js projects, and to make it easier to build full-stack JavaScript applications. We hope it makes your life a little bit easier!
### Version info

This app was originally generated on Thu May 30 2019 10:19:52 GMT-0500 (CDT) using Sails v1.0.2.

## Version info
<!-- Internally, Sails used [`sails-generate@1.15.28`](https://github.com/balderdashy/sails-generate/tree/v1.15.28/lib/core-generators/new). -->

This app was originally generated on Sun Mar 25 2018 14:03:40 GMT-0500 (CDT) using Sails v1.0.0-47.

<!-- Internally, Sails used [`sails-generate@1.15.7`](https://github.com/balderdashy/sails-generate/tree/v1.15.7/lib/core-generators/new). -->
This project's boilerplate is based on an expanded seed app provided by the [Sails core team](https://sailsjs.com/about) to make it easier for you to build on top of ready-made features like authentication, enrollment, email verification, and billing. For more information, [drop us a line](https://sailsjs.com/support).


<!--
Note: Generators are usually run using the globally-installed `sails` CLI (command-line interface). This CLI version is _environment-specific_ rather than app-specific, thus over time, as a project's dependencies are upgraded or the project is worked on by different developers on different computers using different versions of Node.js, the Sails dependency in its package.json file may differ from the globally-installed Sails CLI release it was originally generated with. (Be sure to always check out the relevant [upgrading guides](https://sailsjs.com/upgrading) before upgrading the version of Sails used by your app. If you're stuck, [get help here](https://sailsjs.com/support).)
-->

## Links

+ [Get started](https://sailsjs.com/get-started)
+ [Sails framework documentation](https://sailsjs.com/documentation)
+ [Version notes / upgrading](https://sailsjs.com/documentation/upgrading)
+ [Deployment tips](https://sailsjs.com/documentation/concepts/deployment)
+ [Community support options](https://sailsjs.com/support)
+ [Professional / enterprise options](https://sailsjs.com/enterprise)


## Contributing
Please observe the guidelines and conventions laid out in the [Sails project contribution guide](https://sailsjs.com/documentation/contributing) when opening issues or submitting pull requests.


## License
The code in this repository, like the [Sails framework](https://sailsjs.com/whats-that), is free and open-source under the [MIT License](https://sailsjs.com/license).
2 changes: 1 addition & 1 deletion api/controllers/deliver-contact-form-message.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ your custom config -- usually in \`config/custom.js\`, \`config/staging.js\`,

await sails.helpers.sendTemplateEmail.with({
to: sails.config.custom.internalEmailAddress,
subject: 'New Contact Form Message',
subject: 'New contact form message',
template: 'internal/email-contact-form',
layout: false,
templateData: {
Expand Down
2 changes: 1 addition & 1 deletion api/controllers/entrance/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ and exposed as \`req.me\`.)`
responseType: 'unauthorized'
// ^This uses the custom `unauthorized` response located in `api/responses/unauthorized.js`.
// To customize the generic "unauthorized" response across this entire app, change that file
// (see http://sailsjs.com/anatomy/api/responses/unauthorized-js).
// (see api/responses/unauthorized).
//
// To customize the response for _only this_ action, replace `responseType` with
// something else. For example, you might set `statusCode: 498` and change the
Expand Down
2 changes: 1 addition & 1 deletion api/controllers/view-homepage-or-redirect.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module.exports = {
success: {
statusCode: 200,
description: 'Requesting user is a guest, so show the public landing page.',
viewTemplatePath: 'pages/homepage.ejs'
viewTemplatePath: 'pages/homepage'
},

redirect: {
Expand Down
20 changes: 10 additions & 10 deletions api/helpers/send-template-email.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,16 +168,16 @@ ${htmlEmailContents}

if (!sails.config.custom.mailgunSecret || !sails.config.custom.mailgunDomain) {
throw new Error(`Cannot deliver email to "${inputs.to}" because:
`+(()=>{
let problems = [];
if (!sails.config.custom.mailgunSecret) {
problems.push(' • Mailgun secret is missing from this app\'s configuration (`sails.config.custom.mailgunSecret`)');
}
if (!sails.config.custom.mailgunDomain) {
problems.push(' • Mailgun domain is missing from this app\'s configuration (`sails.config.custom.mailgunDomain`)');
}
return problems.join('\n');
})()+`
`+(()=>{
let problems = [];
if (!sails.config.custom.mailgunSecret) {
problems.push(' • Mailgun secret is missing from this app\'s configuration (`sails.config.custom.mailgunSecret`)');
}
if (!sails.config.custom.mailgunDomain) {
problems.push(' • Mailgun domain is missing from this app\'s configuration (`sails.config.custom.mailgunDomain`)');
}
return problems.join('\n');
})()+`

To resolve these configuration issues, add the missing config variables to
\`config/custom.js\`-- or in staging/production, set them up as system
Expand Down
17 changes: 12 additions & 5 deletions api/hooks/custom/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ will be disabled and/or hidden in the UI.
skipAssets: true,
fn: async function(req, res, next){

var url = require('url');

// First, if this is a GET request (and thus potentially a view),
// attach a couple of guaranteed locals.
if (req.method === 'GET') {
Expand All @@ -136,16 +138,21 @@ will be disabled and/or hidden in the UI.
throw new Error('Cannot attach view local `me`, because this view local already exists! (Is it being attached somewhere else?)');
}
res.locals.me = undefined;

}//fi

// Next, check if this is a GET request to the `webhooks.` or `click.`
// subdomains. If so, we'll automatically go ahead and redirect to the
// corresponding path under our base URL, which is environment-specific.
// Next, if we're running in our actual "production" or "staging" Sails
// environment, check if this is a GET request via some other subdomain,
// for example something like `webhooks.` or `click.`. If so, we'll
// automatically go ahead and redirect to the corresponding path under
// our base URL, which is environment-specific.
// > Note that we DO NOT redirect virtual socket requests and we DO NOT
// > redirect non-GET requests (because it can confuse some 3rd party
// > platforms that send webhook requests.)
if (!req.isSocket && req.method === 'GET' && (req.subdomains[0] === 'webhooks' || req.subdomains[0] === 'links')) {
var configuredBaseSubdomain;
try {
configuredBaseSubdomain = url.parse(sails.config.custom.baseUrl).host.match(/^([^\.]+)\./)[1];
} catch (unusedErr) { /*…*/}
if ((sails.config.environment === 'staging' || sails.config.environment === 'production') && !req.isSocket && req.method === 'GET' && req.subdomains[0] !== configuredBaseSubdomain) {
sails.log.info('Redirecting GET request from `'+req.subdomains[0]+'.` subdomain...');
return res.redirect(sails.config.custom.baseUrl+req.url);
}//•
Expand Down
2 changes: 1 addition & 1 deletion assets/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@
"parasails": true,
"$": true,
"_": true,
"bowser": true,
"StripeCheckout": true,
"Stripe": true,
"Vue": true,
"VueRouter": true,
// "moment": true,
// "bowser": true
// ...etc.
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Expand Down
Loading