This file contains hidden or 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
import router from 'next/router'; | |
import { USER_ROLES } from './'; | |
export function useLoginRouter({ role, accessToken }: { role: string; accessToken: string; }){ | |
if (role === USER_ROLES.SCOUT) { | |
return router.push(process.env.NEXT_PUBLIC_SCOUT_URL + '?userId=' + accessToken); | |
} else if (role === USER_ROLES.OWNER) { | |
return router.push(process.env.NEXT_PUBLIC_OWNER_URL + '?userId=' + accessToken); | |
} else if (role === USER_ROLES.SERVICE_PROVIDER) { |
This file contains hidden or 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
server { | |
listen 80; | |
server_name app.domain.com; | |
location / { | |
proxy_pass http://localhost:7000; | |
proxy_http_version 1.1; | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection 'upgrade'; |
This file contains hidden or 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
const fs = require('fs') | |
const path = require('path') | |
const utils = require('util') | |
const puppeteer = require('puppeteer') | |
const hb = require('handlebars') | |
const readFile = utils.promisify(fs.readFile) | |
const fileName = './sample.pdf' | |
function getFile() { |
This file contains hidden or 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
import express from 'express'; | |
import { config } from 'dotenv'; | |
import routes from './routes'; | |
config(); | |
const app = express(); | |
app.use(routes); | |
app.listen(); |
This file contains hidden or 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
'use strict'; | |
module.exports = (sequelize, DataTypes) => { | |
const list = sequelize.define('list', { | |
item: DataTypes.STRING, | |
priority: DataTypes.ENUM('very important', 'important', 'maybe'), | |
quantity: DataTypes.INTEGER, | |
UserId: DataTypes.INTEGER | |
}, {}); | |
list.associate = function(models) { | |
// associations can be defined here |
This file contains hidden or 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
module.exports = (sequelize, DataTypes) => { | |
const User = sequelize.define('User', { | |
username: { | |
type: DataTypes.STRING, | |
allowNull: false | |
}, | |
password: { | |
type: DataTypes.STRING, | |
allowNull: false | |
}, |
This file contains hidden or 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
import { config } from 'dotenv'; | |
config(); | |
module.exports = { | |
development: { | |
username: process.env.DB_USER, | |
password: process.env.DB_PASSWORD, | |
database: process.env.DB_NAME, | |
host: process.env.DB_HOST, |
This file contains hidden or 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
const path = require('path'); | |
const dotenv = require('dotenv'); | |
dotenv.config(); | |
if(process.env.NODE_ENV != 'production'){ | |
require('@babel/register'); | |
module.exports = { | |
"config": path.resolve("./src/database", "config.js"), | |
"models-path": path.resolve("./src/models"), |
This file contains hidden or 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
import express from 'express'; | |
import listRouter from './listRoutes'; | |
const Router = express.Router(); | |
Router.get('/', (req, res) => { | |
res.status(200).send({ | |
message: 'Welcome, add your wish' | |
}); | |
}) |
NewerOlder