0.4.0b4 register.ts does not need DATABASE_URL
This commit is contained in:
parent
ff6e132ab4
commit
f71c7b0e34
3 changed files with 7 additions and 4 deletions
4
package-lock.json
generated
4
package-lock.json
generated
|
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "sknsybot",
|
"name": "sknsybot",
|
||||||
"version": "0.4.0.b3",
|
"version": "0.4.0.b4",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "sknsybot",
|
"name": "sknsybot",
|
||||||
"version": "0.4.0.b3",
|
"version": "0.4.0.b4",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"chalk": "^5.4.1",
|
"chalk": "^5.4.1",
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "sknsybot",
|
"name": "sknsybot",
|
||||||
"version": "0.4.0.b3",
|
"version": "0.4.0.b4",
|
||||||
"private": true,
|
"private": true,
|
||||||
"description": "",
|
"description": "",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,10 @@ import * as schema from "./schema";
|
||||||
import { Pool } from "pg";
|
import { Pool } from "pg";
|
||||||
|
|
||||||
function urlToObj(url: string) {
|
function urlToObj(url: string) {
|
||||||
if (!url) throw new Error('DATABASE_URL is not set');
|
if (!url) {
|
||||||
|
console.warn("DATABASE_URL is not set, expect the database to not connect");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
const { username, password, hostname, port, pathname } = URL.parse(url);
|
const { username, password, hostname, port, pathname } = URL.parse(url);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue