This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react" | |
const HomeSearch = () => { | |
return ( | |
<h1>home search</h1> | |
) | |
} | |
export default HomeSearch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import PropTypes from "prop-types" | |
import Menu from './menu' | |
import HomeSearch from './home-search' | |
import Footer from './footer' | |
const Layout = ({ children }) => { | |
return ( | |
<> | |
<Menu></Menu> | |
<HomeSearch></HomeSearch> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import PropTypes from "prop-types" | |
import Menu from './menu' | |
import HomeSearch from './home-search' | |
import Footer from './footer' | |
const Layout = ({ children }) => { | |
return ( | |
<> | |
<Menu></Menu> | |
<HomeSearch></HomeSearch> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import scrapy | |
import logging | |
from datetime import date, datetime | |
import sys | |
logfile = "logs/log"+date.today().strftime("%Y%m%d")+'.txt' | |
logging.basicConfig(filename=logfile, level=logging.DEBUG) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"context" | |
"encoding/json" | |
"fmt" | |
"net/http" | |
"time" | |
"go.mongodb.org/mongo-driver/bson" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func getJobPostsEndpoint(response http.ResponseWriter, request *http.Request) { | |
response.Header().Add("content-type", "application/json") | |
var jobs []Job | |
collection := client.Database("Default").Collection("AppJobs") | |
ctx, _ := context.WithTimeout(context.Background(), 30*time.Second) | |
cursor, err := collection.Find(ctx, bson.M{}) | |
if err != nil { | |
response.WriteHeader(http.StatusInternalServerError) | |
response.Write([]byte(`{"message": ` + err.Error() + `"}`)) | |
return |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Job struct { | |
// ID primitive.ObjectID `json:"_id,omitempty" bson:"_id,omitempty"` | |
Title string `json:"Title,omitempty" bson:"Title,omitempty"` | |
CompanyName string `json:"CompanyName" bson:"CompanyName"` | |
City string `json:"City" bson:"City"` | |
Country string `json:"Country" bson:"Country"` | |
CompanyLogoUrl string `json:"CompanyLogoUrl" bson:"CompanyLogoUrl"` | |
JobUrl string `json:"Url" bson:"Url"` | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Sequelize = require('sequelize'); | |
const sequelize = require('../util/database'); | |
const Product = sequelize.define('product', { | |
id: { | |
type: Sequelize.INTEGER, | |
autoIncrement: true, | |
allowNull: false, | |
primaryKey: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Sequelize = require('sequelize'); | |
const sequelize = require('../util/database'); | |
const Product = sequelize.define('product', { | |
id: { | |
type: Sequelize.INTEGER, | |
autoIncrement: true, | |
allowNull: false, | |
primaryKey: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Sequelize = require('sequelize'); | |
const sequelize = new Sequelize('vooy-shops', 'root', '123456', { | |
dialect: 'mysql', | |
host: 'localhost' | |
}); | |
module.exports = sequelize; |