This file contains hidden or 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 the ethers library | |
const ethers = require('ethers'); | |
// Connect to the Ethereum mainnet | |
let provider = new ethers.providers.JsonRpcProvider('https://mainnet.infura.io/v3/INFURA_PROJECT_ID'); | |
// Define the addresses to look up | |
let addresses = [ | |
'0x57f1887a8BF19b14fC0dF6Fd9B2acc9Af147eA85', | |
'0xf4bfaf916a68b0fC859D63a319034C0f72A88a5C', |
This file contains hidden or 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 express from 'express'; | |
import multer from 'multer'; | |
import { userController } from '../controllers'; | |
const { signup } = userController; | |
const router = express.Router(); | |
router | |
.route('/signup') |
This file contains hidden or 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 mongoose, { Schema } from 'mongoose'; | |
const userSchema = new Schema({ | |
email: String, | |
password: String, | |
firstname: String, | |
lastname: String, | |
avatar: String | |
}); |
This file contains hidden or 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 { userModel as Users } from '../models'; | |
import aws from 'aws-sdk'; | |
import fs from 'fs'; | |
export default { | |
signup(req, res) { | |
aws.config.setPromisesDependency(); | |
aws.config.update({ | |
accessKeyId: process.env.ACCESSKEYID, | |
secretAccessKey: process.env.SECRETACCESSKEY, |
This file contains hidden or 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 app from './app'; | |
const port = process.env.PORT || 3000; | |
app.listen(port, () => { | |
console.log(`App running on ${port}`); | |
}); |
This file contains hidden or 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 express from 'express'; | |
import mongoose from 'mongoose'; | |
import dotenv from 'dotenv'; | |
import { userRoute } from './routes'; | |
dotenv.config(); | |
const app = express(); |
This file contains hidden or 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 com.otoloye.RestWithSpringBoot.controller; | |
import com.otoloye.RestWithSpringBoot.model.Package; | |
import com.otoloye.RestWithSpringBoot.repository.PackageRepository; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.web.bind.annotation.*; | |
import java.util.List; | |
@RestController |
This file contains hidden or 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 com.otoloye.RestWithSpringBoot.repository; | |
import com.otoloye.RestWithSpringBoot.model.Package; | |
import org.springframework.stereotype.Repository; | |
import java.util.ArrayList; | |
import java.util.Date; | |
import java.util.Iterator; | |
import java.util.List; |
This file contains hidden or 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 com.otoloye.RestWithSpringBoot.model; | |
import java.util.Date; | |
public class Package { | |
private Integer id; | |
private String name; |
This file contains hidden or 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 com.otoloye.RestWithSpringBoot; | |
import org.springframework.boot.SpringApplication; | |
import org.springframework.boot.autoconfigure.SpringBootApplication; | |
@SpringBootApplication | |
public class RestWithSpringBootApplication { | |
public static void main(String[] args) { | |
SpringApplication.run(RestWithSpringBootApplication.class, args); |
NewerOlder