🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

rest-framework-template

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rest-framework-template - npm Package Compare versions

Comparing version
1.0.0
to
1.0.1
+31
template/.env
VERSION=1.0.0.0
APP_NAME=DemoApp
PORT=80
DATABASE=mongodb://localhost:27017/viwe
CORS_ENABLED=true
CORS_ORIGIN=http://localhost:3000
SESSION_TIMEOUT=86400
API_PREFIX=api
WEB_DISABLED=false
STATIC_CONTENT_PATH=Public
SMTP_HOST=codehuntz.com
SMTP_PORT=587
SMTP_USERNAME=test@codehuntz.com
SMTP_PASSWORD=123456
SMTP_SECURE=false
SMTP_DEFAULT_EMAIL=deveshmig125@gmail.com
SMTP_IGNORE_TLS=true
TWILIO_ACCOUNT_SID=xyz
TWILIO_AUTH_TOKEN=xyz
GOOGLE_CLIENT_ID=803370434630-4rud03224e76id30lch382sbifrssgdh.apps.googleusercontent.com
GOOGLE_SECRATE=9PHbr64ctrOwWZKX6rfU3tk8
GOOGLE_REDIRECTURI=http: //localhost:5000/api/google
GOOGLE_APP_REDIRECT=/
GOOGLE_AUTH_FAIL_REDIRECT=/Login?error=User not registered
const Controller = require('rest-framework/Controller');
class User extends Controller {
isAuthEnabled = false;
};
module.exports = User;
const RestFramework = require('rest-framework');
const StartupBase = require('rest-framework/StartupBase');
const TestTask = require('./Task/TestTask');
class Startup extends StartupBase {
async onConfigure(app, server) {
super.onConfigure(app, server)
RestFramework.TaskManager.Add(new TestTask(), '* */5 * * * *', "TestTask");
}
async onException(error) {
console.log("----------------ERROR-LOGGER---------------");
console.log(error.stack);
}
}
RestFramework.StartApp(Startup);
const mongoose = require('mongoose');
const Schema = mongoose.Schema
const schema = new Schema({
firstname: { type: String },
lastname: { type: String },
username: { type: String, unique: true },
password: { type: String },
displayPicture: { type: String },
email: { type: String, unique: true },
role: { type: Number, default: 2 },//2 = user
isActive: { type: Boolean, default: false },
passKey: { type: String },
passwordResetRequestOn: { type: Date }
}, { timestamps: true });
const model = mongoose.model('User', schema, 'User');
module.exports = model;

Sorry, the diff of this file is not supported yet

class TestTask {
async execute() {
console.log(`Task Called: ${new Date()}`)
}
}
module.exports = TestTask;
<!DOCTYPE html>
<html>
<style>
body,
html {
height: 100%;
margin: 0;
}
.bg {
background: black;
height: 100%;
background-position: center;
background-size: cover;
position: relative;
color: white;
font-family: "Courier New", Courier, monospace;
font-size: 25px;
}
.middle {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
text-align: center;
}
hr {
margin: auto;
width: 40%;
}
</style>
<body>
<div class="bg">
<div class="middle">
<h1>Welcome to Rest Api Framework</h1>
<hr>
<p>Code should be easy</p>
</div>
</div>
</body>
</html>
const WebPage = require('rest-framework/WebPage');
class Default extends WebPage {
isAuthEnabled = false;
extra = {};
}
module.exports = Default;
<!DOCTYPE html>
<html>
<style>
body,
html {
height: 100%;
margin: 0;
}
.bg {
background: black;
height: 100%;
background-position: center;
background-size: cover;
position: relative;
color: white;
font-family: "Courier New", Courier, monospace;
font-size: 25px;
}
.middle {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
text-align: center;
}
hr {
margin: auto;
width: 40%;
}
</style>
<body>
<div class="bg">
<div class="middle">
<h1>Welcome to Rest Api Framework</h1>
<hr>
<p>Code should be easy</p>
</div>
</div>
</body>
</html>
const WebPage = require('rest-framework/WebPage');
class Home extends WebPage {
isAuthEnabled = false;
extra = {};
async pageLoad(http) {
super.pageLoad(http);
}
}
module.exports = Home;
<!DOCTYPE html>
<html>
<style>
body,
html {
height: 100%;
margin: 0;
}
.bg {
background: black;
height: 100%;
background-position: center;
background-size: cover;
position: relative;
color: white;
font-family: "Courier New", Courier, monospace;
font-size: 25px;
}
.middle {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
text-align: center;
}
hr {
margin: auto;
width: 40%;
}
</style>
<body>
<div class="bg">
<div class="middle">
<h1>Nested Page -> www.xyz.com/home/netsed</h1>
<hr>
<p>Code should be easy</p>
</div>
</div>
</body>
</html>
const WebPage = require('rest-framework/WebPage');
class Nested extends WebPage {
isAuthEnabled = false;
extra = {};
async pageLoad(http) {
super.pageLoad(http);
}
}
module.exports = Nested;
+1
-1
{
"name": "rest-framework-template",
"version": "1.0.0",
"version": "1.0.1",
"description": "",

@@ -5,0 +5,0 @@ "main": "index.js",

-31
VERSION=1.0.0.0
APP_NAME=DemoApp
PORT=80
DATABASE=mongodb://localhost:27017/viwe
CORS_ENABLED=true
CORS_ORIGIN=http://localhost:3000
SESSION_TIMEOUT=86400
API_PREFIX=api
WEB_DISABLED=false
STATIC_CONTENT_PATH=Public
SMTP_HOST=codehuntz.com
SMTP_PORT=587
SMTP_USERNAME=test@codehuntz.com
SMTP_PASSWORD=123456
SMTP_SECURE=false
SMTP_DEFAULT_EMAIL=deveshmig125@gmail.com
SMTP_IGNORE_TLS=true
TWILIO_ACCOUNT_SID=xyz
TWILIO_AUTH_TOKEN=xyz
GOOGLE_CLIENT_ID=803370434630-4rud03224e76id30lch382sbifrssgdh.apps.googleusercontent.com
GOOGLE_SECRATE=9PHbr64ctrOwWZKX6rfU3tk8
GOOGLE_REDIRECTURI=http: //localhost:5000/api/google
GOOGLE_APP_REDIRECT=/
GOOGLE_AUTH_FAIL_REDIRECT=/Login?error=User not registered
const Controller = require('rest-framework/Controller');
class User extends Controller {
isAuthEnabled = false;
};
module.exports = User;
const RestFramework = require('rest-framework');
const StartupBase = require('rest-framework/StartupBase');
const TestTask = require('./Task/TestTask');
class Startup extends StartupBase {
async onConfigure(app, server) {
super.onConfigure(app, server)
RestFramework.TaskManager.Add(new TestTask(), '* */5 * * * *', "TestTask");
}
async onException(error) {
console.log("----------------ERROR-LOGGER---------------");
console.log(error.stack);
}
}
RestFramework.StartApp(Startup);
const mongoose = require('mongoose');
const Schema = mongoose.Schema
const schema = new Schema({
firstname: { type: String },
lastname: { type: String },
username: { type: String, unique: true },
password: { type: String },
displayPicture: { type: String },
email: { type: String, unique: true },
role: { type: Number, default: 2 },//2 = user
isActive: { type: Boolean, default: false },
passKey: { type: String },
passwordResetRequestOn: { type: Date }
}, { timestamps: true });
const model = mongoose.model('User', schema, 'User');
module.exports = model;

Sorry, the diff of this file is not supported yet

class TestTask {
async execute() {
console.log(`Task Called: ${new Date()}`)
}
}
module.exports = TestTask;
<!DOCTYPE html>
<html>
<style>
body,
html {
height: 100%;
margin: 0;
}
.bg {
background: black;
height: 100%;
background-position: center;
background-size: cover;
position: relative;
color: white;
font-family: "Courier New", Courier, monospace;
font-size: 25px;
}
.middle {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
text-align: center;
}
hr {
margin: auto;
width: 40%;
}
</style>
<body>
<div class="bg">
<div class="middle">
<h1>Welcome to Rest Api Framework</h1>
<hr>
<p>Code should be easy</p>
</div>
</div>
</body>
</html>
const WebPage = require('rest-framework/WebPage');
class Default extends WebPage {
isAuthEnabled = false;
extra = {};
}
module.exports = Default;
<!DOCTYPE html>
<html>
<style>
body,
html {
height: 100%;
margin: 0;
}
.bg {
background: black;
height: 100%;
background-position: center;
background-size: cover;
position: relative;
color: white;
font-family: "Courier New", Courier, monospace;
font-size: 25px;
}
.middle {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
text-align: center;
}
hr {
margin: auto;
width: 40%;
}
</style>
<body>
<div class="bg">
<div class="middle">
<h1>Welcome to Rest Api Framework</h1>
<hr>
<p>Code should be easy</p>
</div>
</div>
</body>
</html>
const WebPage = require('rest-framework/WebPage');
class Home extends WebPage {
isAuthEnabled = false;
extra = {};
async pageLoad(http) {
super.pageLoad(http);
}
}
module.exports = Home;
<!DOCTYPE html>
<html>
<style>
body,
html {
height: 100%;
margin: 0;
}
.bg {
background: black;
height: 100%;
background-position: center;
background-size: cover;
position: relative;
color: white;
font-family: "Courier New", Courier, monospace;
font-size: 25px;
}
.middle {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
text-align: center;
}
hr {
margin: auto;
width: 40%;
}
</style>
<body>
<div class="bg">
<div class="middle">
<h1>Nested Page -> www.xyz.com/home/netsed</h1>
<hr>
<p>Code should be easy</p>
</div>
</div>
</body>
</html>
const WebPage = require('rest-framework/WebPage');
class Nested extends WebPage {
isAuthEnabled = false;
extra = {};
async pageLoad(http) {
super.pageLoad(http);
}
}
module.exports = Nested;