generated from Daelso/Quasar-node-userAuth-template
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #157 from Daelso/hunter_fix
Hunter fix
- Loading branch information
Showing
12 changed files
with
572 additions
and
13 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
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,25 @@ | ||
const express = require("express"); | ||
const cookieParser = require("cookie-parser"); | ||
const sequelize = require("../database"); | ||
require("dotenv").config(); | ||
const app = express(); | ||
|
||
let router = express.Router(); | ||
router.use(cookieParser()); | ||
app.use(express.json()); | ||
app.use(express.urlencoded({ extended: true })); | ||
const GameStyles = require("../models/game_finder/game_styles.js"); | ||
const lib = require("../lib"); | ||
|
||
//Route is base/game_finder/ | ||
router.route("/styles").get(lib.getLimiter, async (req, res) => { | ||
try { | ||
const styles = await GameStyles.findAll(); | ||
|
||
res.status(200).json(styles); | ||
} catch (err) { | ||
res.status(403).send(err); | ||
} | ||
}); | ||
|
||
module.exports = router; //Exports our routes |
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,21 @@ | ||
const Sequelize = require("sequelize"); | ||
const db = require("../../database"); | ||
|
||
const GameStyles = db.sequelize.define( | ||
"game_styles", | ||
{ | ||
style_id: { | ||
type: Sequelize.INTEGER, | ||
allowNull: false, | ||
primaryKey: true, | ||
autoIncrement: true, | ||
}, | ||
style: { | ||
type: Sequelize.STRING, | ||
allowNull: false, | ||
}, | ||
}, | ||
{ timestamps: false } | ||
); | ||
|
||
module.exports = GameStyles; |
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 |
---|---|---|
@@ -1,24 +1,24 @@ | ||
import { boot } from 'quasar/wrappers' | ||
import axios from 'axios' | ||
import { boot } from "quasar/wrappers"; | ||
import axios from "axios"; | ||
|
||
// Be careful when using SSR for cross-request state pollution | ||
// due to creating a Singleton instance here; | ||
// If any client changes this (global) instance, it might be a | ||
// good idea to move this instance creation inside of the | ||
// "export default () => {}" function below (which runs individually | ||
// for each client) | ||
const api = axios.create({ baseURL: 'https://api.example.com' }) | ||
const api = axios.create({ baseURL: "https://api.example.com" }); | ||
|
||
export default boot(({ app }) => { | ||
// for use inside Vue files (Options API) through this.$axios and this.$api | ||
|
||
app.config.globalProperties.$axios = axios | ||
app.config.globalProperties.$axios = axios; | ||
// ^ ^ ^ this will allow you to use this.$axios (for Vue Options API form) | ||
// so you won't necessarily have to import axios in each vue file | ||
|
||
app.config.globalProperties.$api = api | ||
app.config.globalProperties.$api = api; | ||
// ^ ^ ^ this will allow you to use this.$api (for Vue Options API form) | ||
// so you can easily perform requests against your app's API | ||
}) | ||
}); | ||
|
||
export { api } | ||
export { api }; |
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
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
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
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
Oops, something went wrong.