mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-21 00:59:29 +00:00
Improve environment separation
This commit is contained in:
parent
093552fad0
commit
53e85cdd60
4 changed files with 12 additions and 7 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import algoliasearch from "algoliasearch";
|
||||
import { ALGOLIA_INDEX, ALGOLIA_KEY } from "./config";
|
||||
import { ALGOLIA_ACCOUNT, ALGOLIA_KEY, ALGOLIA_INDEX } from "./config";
|
||||
|
||||
const client = algoliasearch(ALGOLIA_INDEX, ALGOLIA_KEY);
|
||||
export const searchIndex = client.initIndex("Skins");
|
||||
const client = algoliasearch(ALGOLIA_ACCOUNT, ALGOLIA_KEY);
|
||||
export const searchIndex = client.initIndex(ALGOLIA_INDEX);
|
||||
|
|
|
|||
|
|
@ -2,7 +2,11 @@ import { Router } from "express";
|
|||
import asyncHandler from "express-async-handler";
|
||||
import SkinModel from "../data/SkinModel";
|
||||
import * as Skins from "../data/skins";
|
||||
import { DISCORD_CLIENT_ID, DISCORD_REDIRECT_URL } from "../config";
|
||||
import {
|
||||
DISCORD_CLIENT_ID,
|
||||
DISCORD_REDIRECT_URL,
|
||||
LOGIN_REDIRECT_URL,
|
||||
} from "../config";
|
||||
import S3 from "../s3";
|
||||
import LRU from "lru-cache";
|
||||
import { MuseumPage } from "../data/skins";
|
||||
|
|
@ -55,7 +59,7 @@ router.get(
|
|||
req.session.username = username;
|
||||
|
||||
// TODO: What about dev?
|
||||
res.redirect(302, `https://skins.webamp.org/review/`);
|
||||
res.redirect(302, LOGIN_REDIRECT_URL);
|
||||
})
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -460,7 +460,7 @@ export async function setTweetInfo(
|
|||
.where({ skin_md5: md5 })
|
||||
.first(["likes", "retweets"]);
|
||||
if (first == null) {
|
||||
await knex("skins").insert(
|
||||
await knex("tweets").insert(
|
||||
{
|
||||
skin_md5: md5,
|
||||
tweet_id: tweetId,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import Knex from "knex";
|
||||
import * as knexConfigs from "./knexfile";
|
||||
import { NODE_ENV } from "./config";
|
||||
|
||||
export const knex = Knex(knexConfigs[process.env.NODE_ENV || "development"]);
|
||||
export const knex = Knex(knexConfigs[NODE_ENV]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue