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
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>com.otoloye</groupId> | |
<artifactId>RestWithSpringBoot</artifactId> | |
<version>0.0.1-SNAPSHOT</version> | |
<packaging>jar</packaging> |
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); |
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.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.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
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
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 { 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 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 express from 'express'; | |
import multer from 'multer'; | |
import { userController } from '../controllers'; | |
const { signup } = userController; | |
const router = express.Router(); | |
router | |
.route('/signup') |
OlderNewer