Skip to content

Instantly share code, notes, and snippets.

View tochman's full-sized avatar
💭
Coding on my own SaaS project (Rails + React)

Thomas Ochman tochman

💭
Coding on my own SaaS project (Rails + React)
View GitHub Profile
@tochman
tochman / README.md
Created December 8, 2023 14:11 — forked from horosin/README.md
Extracting and Generating JSON Data with GPTs, LangChain, and Node.js
describe("Authentication:", () => {
beforeEach(() => {
cy.visit("/");
cy.intercept("POST", "https://hooks.slack.com/services/**", {
body: { message: "ok" },
statusCode: 200,
}).as("slackHook");
});
});
import React, { useState, useEffect } from "react";
import axios from "axios";
import { Item } from "semantic-ui-react";
import EmployeeModal from "./EmployeeModal";
const EmployeeList = () => {
const [employees, setEmployees] = useState([]);
const [message, setMessage] = useState();
const fetchData = async () => {
{
"page": 2,
"per_page": 6,
"total": 12,
"total_pages": 2,
"data": [
{
"id": 7,
"email": "michael.lawson@reqres.in",
"first_name": "Thomas",

Setting up the project structure

Technology

  • Server: superstatic
  • Implementation code location: src
  • Test locations:
    • Acceptance tests: cypress/integration
    • Unit tests: specs
  • Test dependencies:
    • Acceptance tests: Cypress
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>WS Chat Demo</title>
</head>
<body>
<h1>Connection <span id="connection">is closed</span></h1>
cy.get("iframe[id=the-id-or-class-or-name]").then(iframe => {
const body = iframe.contents().find('body')
cy.wrap(body)
.find('[data-cy=whatever]')
})
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
{
"type": "page",
"pageType": "category",
"sectionId": "35bb8a90-d40e-11e2-8b8b-0800200c9a66",
"title": "TV-serier online - Streama bra serier på nätet el ladda ned",
"description": "Viaplay erbjuder serier på nätet för hela familjen. Streama bra TV-serier online i hög kvalitet eller ladda ned till tablet eller mobil!",
"styles": [
"category"
],
"_links": {

Once the db is created and populated with the 2 books, we want to test the connection in node console.

I your terminal, open the node console like this:

$ node
Welcome to Node.js v13.1.0.
Type ".help" for more information.
>