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
--- | |
apiVersion: policy/v1beta1 | |
kind: PodSecurityPolicy | |
metadata: | |
name: psp.flannel.unprivileged | |
annotations: | |
seccomp.security.alpha.kubernetes.io/allowedProfileNames: docker/default | |
seccomp.security.alpha.kubernetes.io/defaultProfileName: docker/default | |
apparmor.security.beta.kubernetes.io/allowedProfileNames: runtime/default | |
apparmor.security.beta.kubernetes.io/defaultProfileName: runtime/default |
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
<!DOCTYPE html> | |
<html> | |
<head><title></title> | |
<link rel="stylesheet" href="app.min.css"> | |
</head> | |
<body class="ph3 pt0 pb4 mw7 center sans-serif"> | |
<h1 class="f2 mb0"><span class="gold">k</span>note</h1> | |
<p class="f5 mt1 mb4 lh-copy">A simple note-taking app.</p> | |
<form action="/note" method="POST" enctype="multipart/form-data"> | |
<ol class="list pl0"> |
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 io.learnk8s.knote; | |
import org.springframework.boot.SpringApplication; | |
import org.springframework.boot.autoconfigure.SpringBootApplication; | |
@SpringBootApplication | |
public class KnoteJavaApplication { | |
public static void main(String[] args) { | |
SpringApplication.run(KnoteJavaApplication.class, args); |
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
spring.data.mongodb.uri=mongodb://localhost:27017/dev |
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
@Document(collection = "notes") | |
@Setter | |
@Getter | |
@NoArgsConstructor | |
@AllArgsConstructor | |
class NoteEntity { | |
@Id | |
private String id; | |
private String description; |
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
... | |
interface NotesRepository extends MongoRepository<Note, String> { | |
} |
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
.... | |
@Controller | |
class KNoteController { | |
@Autowired | |
private NotesRepository notesRepository; | |
private Parser parser = Parser.builder().build(); | |
private HtmlRenderer renderer = HtmlRenderer.builder().build(); |
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
<dependencies> | |
... | |
<dependency> | |
<groupId>com.atlassian.commonmark</groupId> | |
<artifactId>commonmark</artifactId> | |
<version>0.12.1</version> | |
</dependency> | |
... | |
</dependencies> |
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
... | |
@ConfigurationProperties(prefix = "knote") | |
class KnoteProperties { | |
@Value("${uploadDir:/tmp/uploads/}") | |
private String uploadDir; | |
public String getUploadDir() { | |
return uploadDir; | |
} | |
} |
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
... | |
@Configuration | |
@EnableConfigurationProperties(KnoteProperties.class) | |
class KnoteConfig implements WebMvcConfigurer { | |
@Autowired | |
private KnoteProperties properties; | |
@Override | |
public void addResourceHandlers(ResourceHandlerRegistry registry) { |
OlderNewer