SEI-ATL / UNIT_2

This repo is for all things Unit 2
0 stars 3 forks source link

Friday, November 13, 2020 #2

Closed romebell closed 3 years ago

romebell commented 3 years ago

Admin 👀 - [admin] is looking into it 👍 - [admin] Answer issue. Looks good. Code works.

Students 🚀 - [student] I get it! 😕 - [student] Still confused 😄 - [student] A simple error 🎉 - [student] My code now works

Admin/Students ❤️ - [student/admin] Love the topic or code snippet 👎 - [student/admin] Code didn't work

maddevred commented 3 years ago

@romebell Screenshot from 2020-11-13 10-40-15

Swolepenguin commented 3 years ago

Ashton

lev-choubine commented 3 years ago

Lev

CoreyWilson319 commented 3 years ago

Corey

lev-choubine commented 3 years ago

I am all caught up now. I am good thanks.

canourrea23 commented 3 years ago

I didn't add the VALUES before closing

carolinaurrea=# \connect testdb;
You are now connected to database "testdb" as user "carolinaurrea".
testdb=# CREATE TABLE students (
testdb(# id SERIAL PRIMARY KEY,
testdb(# name TEXT
testdb(# );
CREATE TABLE
testdb=# INSERT INTO students
testdb-# (name, phone, email)
testdb-# VALUES
testdb-# ('William', '(415)777-8888', 'william@ga.co');
ERROR:  column "phone" of relation "students" does not exist
LINE 2: (name, phone, email)
pmacaluso3 commented 3 years ago

Carolina, you have a few options. You can drop the students table and recreate it including the phone column. You can also use a command like this which we're not officially covering this morning, but it's good to know:

ALTER TABLE students ADD phone text

There is documentation for it here: https://www.w3schools.com/sql/sql_alter.asp

canourrea23 commented 3 years ago

Was able to Drop and restart the process.

jtreeves commented 3 years ago

Screen Shot 2020-11-13 at 12 21 40 PM

const express = require('express')
const app = express()

app.get('/', function(req, res) {
    res.send('Hello, world!')
})

app.listen(8000)
maddevred commented 3 years ago

@romebell Screenshot from 2020-11-13 12-47-02

mkzarra commented 3 years ago

@romebell Screenshot from 2020-11-13 12-47-02

remove the function keyword when using =>. They're just different ways to write a function. Either will work here, but they can't be combined.

app.get('/blog', (req, res) => {
    res.send('Welcome to my blog');
});
canourrea23 commented 3 years ago

I am getting this error when I try to run nodemon index.js on an other terminal Screen Shot 2020-11-13 at 3 41 41 PM

romebell commented 3 years ago

@canourrea23 You have a server already running.