Commit fdbb4f67 authored by Zach Perkins's avatar Zach Perkins
Browse files

Deleted the everything

parent 1a0849c5
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
$(document).ready(function() {
// Place JavaScript code here...
});
\ No newline at end of file
import errorHandler from "errorhandler";
import app from "./app";
/**
* Error Handler. Provides full stack - remove for production
*/
app.use(errorHandler());
/**
* Start Express server.
*/
const server = app.listen(app.get("port"), () => {
console.log(
" App is running at http://localhost:%d in %s mode",
app.get("port"),
app.get("env")
);
console.log(" Press CTRL-C to stop\n");
});
export default server;
/// <reference types="express" />
// Add RequestValidation Interface on to Express's Request Interface.
declare namespace Express {
interface Request extends Flash {}
}
interface Flash {
flash(type: string, message: any): void;
}
declare module "express-flash";
/** Declaration file generated by dts-gen */
export const version: string;
export function authorize(params: any, callback: any): any;
export function batch(reqs: any, additionalData: any, callback: any): any;
export function del(url: any, postData: any, callback: any): any;
export function extendAccessToken(params: any, callback: any): any;
export function fql(query: any, params: any, callback: any): any;
export function get(url: any, params?: any, callback?: any): any;
export function getAccessToken(): any;
export function getAppSecret(): any;
export function getGraphUrl(): any;
export function getOauthUrl(params: any, opts: any): any;
export function getOptions(): any;
export function post(url: any, postData: any, callback: any): any;
export function search(options: any, callback: any): any;
export function setAccessToken(token: any): any;
export function setAppSecret(token: any): any;
export function setGraphUrl(url: any): any;
export function setOptions(options: any): any;
export function setVersion(version: any): any;
/**
* Fairly incomplete. I only added some commonly used fields.
*/
export type FacebookUser = {
id: string,
name: string,
email: string,
first_name: string,
last_name: string,
gender: string,
link: string,
locale: string,
timezone: number
};
import winston from "winston";
import { Logger } from "winston";
import { ENVIRONMENT } from "./secrets";
const logger = new (Logger)({
transports: [
new (winston.transports.Console)({ level: process.env.NODE_ENV === "production" ? "error" : "debug" }),
new (winston.transports.File)({ filename: "debug.log", level: "debug"})
]
});
if (process.env.NODE_ENV !== "production") {
logger.debug("Logging initialized at debug level");
}
export default logger;
import logger from "./logger";
import dotenv from "dotenv";
import fs from "fs";
if (fs.existsSync(".env")) {
logger.debug("Using .env file to supply config environment variables");
dotenv.config({ path: ".env" });
} else {
logger.debug("Using .env.example file to supply config environment variables");
dotenv.config({ path: ".env.example" }); // you can delete this after you create your own .env file!
}
export const ENVIRONMENT = process.env.NODE_ENV;
const prod = ENVIRONMENT === "production"; // Anything else is treated as 'dev'
import request from "supertest";
import app from "../src/app";
describe("GET /api", () => {
it("should return 200 OK", () => {
return request(app).get("/api")
.expect(200);
});
});
import request from "supertest";
import app from "../src/app";
describe("GET /random-url", () => {
it("should return 404", (done) => {
request(app).get("/reset")
.expect(404, done);
});
});
import request from "supertest";
import app from "../src/app";
const chai = require("chai");
const expect = chai.expect;
describe("GET /contact", () => {
it("should return 200 OK", (done) => {
request(app).get("/contact")
.expect(200, done);
});
});
describe("POST /contact", () => {
it("should return false from assert when no message is found", (done) => {
request(app).post("/contact")
.field("name", "John Doe")
.field("email", "john@me.com")
.end(function(err, res) {
expect(res.error).to.be.false;
done();
})
.expect(302);
});
});
\ No newline at end of file
import request from "supertest";
import app from "../src/app";
describe("GET /", () => {
it("should return 200 OK", (done) => {
request(app).get("/")
.expect(200, done);
});
});
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment