add cors to /api/shop/items
This commit is contained in:
parent
32d4047278
commit
c26e9e7782
@ -226,6 +226,7 @@ module.exports = function (app, wss, pool) {
|
|||||||
|
|
||||||
app.get("/api/shop/items", async (req, res) => {
|
app.get("/api/shop/items", async (req, res) => {
|
||||||
const conn = await pool.getConnection();
|
const conn = await pool.getConnection();
|
||||||
|
res.set("Access-Control-Allow-Origin", "*");
|
||||||
try {
|
try {
|
||||||
const rows = await conn.query(
|
const rows = await conn.query(
|
||||||
"SELECT id, name, price, quantity FROM shop_items WHERE enabled = 1",
|
"SELECT id, name, price, quantity FROM shop_items WHERE enabled = 1",
|
||||||
@ -240,6 +241,7 @@ module.exports = function (app, wss, pool) {
|
|||||||
|
|
||||||
app.get("/api/shop/items/all", async (req, res) => {
|
app.get("/api/shop/items/all", async (req, res) => {
|
||||||
const conn = await pool.getConnection();
|
const conn = await pool.getConnection();
|
||||||
|
res.set("Access-Control-Allow-Origin", "*");
|
||||||
try {
|
try {
|
||||||
const rows = await conn.query("SELECT * FROM shop_items");
|
const rows = await conn.query("SELECT * FROM shop_items");
|
||||||
res.json({ ok: true, items: rows });
|
res.json({ ok: true, items: rows });
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user