Skip to content

Commit cdf2863

Browse files
committed
Creating a front-end-less sails app
1 parent 5280c72 commit cdf2863

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+2218
-0
lines changed

.editorconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true

.gitignore

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
################################################
2+
############### .gitignore ##################
3+
################################################
4+
#
5+
# This file is only relevant if you are using git.
6+
#
7+
# Files which match the splat patterns below will
8+
# be ignored by git. This keeps random crap and
9+
# and sensitive credentials from being uploaded to
10+
# your repository. It allows you to configure your
11+
# app for your machine without accidentally
12+
# committing settings which will smash the local
13+
# settings of other developers on your team.
14+
#
15+
# Some reasonable defaults are included below,
16+
# but, of course, you should modify/extend/prune
17+
# to fit your needs!
18+
################################################
19+
20+
21+
22+
23+
################################################
24+
# Local Configuration
25+
#
26+
# Explicitly ignore files which contain:
27+
#
28+
# 1. Sensitive information you'd rather not push to
29+
# your git repository.
30+
# e.g., your personal API keys or passwords.
31+
#
32+
# 2. Environment-specific configuration
33+
# Basically, anything that would be annoying
34+
# to have to change every time you do a
35+
# `git pull`
36+
# e.g., your local development database, or
37+
# the S3 bucket you're using for file uploads
38+
# development.
39+
#
40+
################################################
41+
42+
config/local.js
43+
44+
45+
46+
47+
48+
################################################
49+
# Dependencies
50+
#
51+
# When releasing a production app, you may
52+
# consider including your node_modules and
53+
# bower_components directory in your git repo,
54+
# but during development, its best to exclude it,
55+
# since different developers may be working on
56+
# different kernels, where dependencies would
57+
# need to be recompiled anyway.
58+
#
59+
# More on that here about node_modules dir:
60+
# http://www.futurealoof.com/posts/nodemodules-in-git.html
61+
# (credit Mikeal Rogers, @mikeal)
62+
#
63+
# About bower_components dir, you can see this:
64+
# http://addyosmani.com/blog/checking-in-front-end-dependencies/
65+
# (credit Addy Osmani, @addyosmani)
66+
#
67+
################################################
68+
69+
node_modules
70+
bower_components
71+
72+
73+
74+
75+
################################################
76+
# Sails.js / Waterline / Grunt
77+
#
78+
# Files generated by Sails and Grunt, or related
79+
# tasks and adapters.
80+
################################################
81+
.tmp
82+
dump.rdb
83+
84+
85+
86+
87+
88+
################################################
89+
# Node.js / NPM
90+
#
91+
# Common files generated by Node, NPM, and the
92+
# related ecosystem.
93+
################################################
94+
lib-cov
95+
*.seed
96+
*.log
97+
*.out
98+
*.pid
99+
npm-debug.log
100+
101+
102+
103+
104+
105+
################################################
106+
# Miscellaneous
107+
#
108+
# Common files generated by text editors,
109+
# operating systems, file systems, etc.
110+
################################################
111+
112+
*~
113+
*#
114+
.DS_STORE
115+
.netbeans
116+
nbproject
117+
.idea
118+
.node_history

.sailsrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"generators": {
3+
"modules": {}
4+
}
5+
}
12 KB
Binary file not shown.

api/controllers/.gitkeep

Whitespace-only changes.

api/controllers/RoadController.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/**
2+
* RoadController
3+
*
4+
* @description :: Server-side logic for managing roads
5+
* @help :: See http://links.sailsjs.org/docs/controllers
6+
*/
7+
8+
module.exports = {
9+
10+
};
11+

api/models/.Road.js.swp

12 KB
Binary file not shown.

api/models/.gitkeep

Whitespace-only changes.

api/models/Road.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/**
2+
* Road.js
3+
*
4+
* @description :: TODO: You might write a short summary of how this model works and what it represents here.
5+
* @docs :: http://sailsjs.org/#!documentation/models
6+
*/
7+
8+
module.exports = {
9+
10+
attributes: {
11+
12+
}
13+
};
14+

api/policies/sessionAuth.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/**
2+
* sessionAuth
3+
*
4+
* @module :: Policy
5+
* @description :: Simple policy to allow any authenticated user
6+
* Assumes that your login action in one of your controllers sets `req.session.authenticated = true;`
7+
* @docs :: http://sailsjs.org/#!documentation/policies
8+
*
9+
*/
10+
module.exports = function(req, res, next) {
11+
12+
// User is allowed, proceed to the next policy,
13+
// or if this is the last policy, the controller
14+
if (req.session.authenticated) {
15+
return next();
16+
}
17+
18+
// User is not allowed
19+
// (default res.forbidden() behavior can be overridden in `config/403.js`)
20+
return res.forbidden('You are not permitted to perform this action.');
21+
};

0 commit comments

Comments
 (0)